Ticket #8897: r33084-cine-bss_size_reduction.patch

File r33084-cine-bss_size_reduction.patch, 2.9 KB (added by SF/buddha_, 16 years ago)

Patch to reduce the BSS size of Cine engine (0x0d + 0x0a as newlines!)

  • engines/cine/cine.h

     
    9494
    9595        Common::StringList _volumeResourceFiles;
    9696        StringPtrHashMap _volumeEntriesMap;
     97        TextHandler _textHandler;
    9798
    9899private:
    99100        void initialize(void);
  • engines/cine/texte.h

     
    3434typedef char CommandeType[20];
    3535
    3636extern byte *textDataPtr;
    37 extern byte textTable[256][2][16 * 8];
    3837
     38struct TextHandler {
     39        byte textTable[256][2][16 * 8];
     40};
     41
    3942extern const char **failureMessages;
    4043extern const CommandeType *defaultActionCommand;
    4144extern const CommandeType *systemMenu;
  • engines/cine/gfx.cpp

     
    337337                x += 5;
    338338        } else if ((width = fontParamTable[(unsigned char)character].characterWidth)) {
    339339                idx = fontParamTable[(unsigned char)character].characterIdx;
    340                 drawSpriteRaw(textTable[idx][0], textTable[idx][1], 16, 8, _backBuffer, x, y);
     340                drawSpriteRaw(g_cine->_textHandler.textTable[idx][0], g_cine->_textHandler.textTable[idx][1], 16, 8, _backBuffer, x, y);
    341341                x += width + 1;
    342342        }
    343343
     
    938938                x += 5;
    939939        } else if ((width = fontParamTable[(unsigned char)character].characterWidth)) {
    940940                idx = fontParamTable[(unsigned char)character].characterIdx;
    941                 drawSpriteRaw2(textTable[idx][0], 0, 16, 8, _backBuffer, x, y);
     941                drawSpriteRaw2(g_cine->_textHandler.textTable[idx][0], 0, 16, 8, _backBuffer, x, y);
    942942                x += width + 1;
    943943        }
    944944
  • engines/cine/texte.cpp

     
    3131
    3232byte *textDataPtr;
    3333
    34 byte textTable[256][2][16 * 8];
    35 
    3634const char **failureMessages;
    3735const CommandeType *defaultActionCommand;
    3836const CommandeType *systemMenu;
     
    7775                loadRelatedPalette(pFileName);
    7876
    7977                for (i = 0; i < numCharacters; i++) {
    80                         gfxConvertSpriteToRaw(textTable[i][0], tempBuffer, 16, 8);
    81                         generateMask(textTable[i][0], textTable[i][1], 16 * 8, 0);
     78                        gfxConvertSpriteToRaw(g_cine->_textHandler.textTable[i][0], tempBuffer, 16, 8);
     79                        generateMask(g_cine->_textHandler.textTable[i][0], g_cine->_textHandler.textTable[i][1], 16 * 8, 0);
    8280                        tempBuffer += dataSize;
    8381                }
    8482        } else {
    8583                for (i = 0; i < 90; i++) {
    86                         gfxConvertSpriteToRaw(textTable[i][0], tempBuffer, 8, 8);
    87                         generateMask(textTable[i][0], textTable[i][1], 8 * 8, 0);
     84                        gfxConvertSpriteToRaw(g_cine->_textHandler.textTable[i][0], tempBuffer, 8, 8);
     85                        generateMask(g_cine->_textHandler.textTable[i][0], g_cine->_textHandler.textTable[i][1], 8 * 8, 0);
    8886                        tempBuffer += 0x40;
    8987                }
    9088        }