Ticket #8974: ps2-made.patch

File ps2-made.patch, 2.0 KB (added by sunmax, 16 years ago)

ps2-made.patch

  • engines/made/screen.h

    old new  
    203203        bool _screenLock;
    204204        bool _paletteLock;
    205205
    206         byte _screenPalette[256 * 4];
    207         byte _palette[768], _newPalette[768];
     206        byte *_screenPalette;
     207        byte *_palette, *_newPalette;
    208208        int _paletteColorCount, _oldPaletteColorCount;
    209209        bool _paletteInitialized, _needPalette;
    210210        int16 _textColor;
  • engines/made/screen.cpp

    old new  
    3131namespace Made {
    3232
    3333Screen::Screen(MadeEngine *vm) : _vm(vm) {
     34        _screenPalette = (byte *)malloc(256 * 4);
     35        _palette = (byte *)malloc(768);
     36        _newPalette = (byte *)malloc(768);
    3437
    3538        _backgroundScreen = new Graphics::Surface();
    3639        _backgroundScreen->create(320, 200, 1);
     
    9093}
    9194
    9295Screen::~Screen() {
     96    free(_screenPalette);
     97    free(_palette);
     98    free(_newPalette);
     99
    93100        delete _backgroundScreen;
    94101        delete _workScreen;
    95102        if (_vm->getGameID() != GID_RTZ)
  • engines/made/screenfx.h

    old new  
    4040class ScreenEffects {
    4141public:
    4242        ScreenEffects(Screen *screen);
     43        ~ScreenEffects();
    4344        void run(int16 effectNum, Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount);
    4445        void flash(int count, byte *palette, int colorCount);
    4546private:
    4647        Screen *_screen;
    47         byte _fxPalette[768];
     48        byte *_fxPalette;
    4849        static const byte vfxOffsTable[64];
    4950        static const byte vfxOffsIndexTable[8];
    5051        const byte *vfxOffsTablePtr;
  • engines/made/screenfx.cpp

    old new  
    5151        vfxY1 = 0;
    5252        vfxWidth = 0;
    5353        vfxHeight = 0;
     54
     55        _fxPalette = (byte *)malloc(768);
     56}
     57
     58ScreenEffects::~ScreenEffects() {
     59        free (_fxPalette);
    5460}
    5561
    5662void ScreenEffects::run(int16 effectNum, Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {