Ticket #9203: dirty-rect-safety-valve2.diff

File dirty-rect-safety-valve2.diff, 1.2 KB (added by eriktorbjorn, 13 years ago)

Patch against current SVN (after graphics restructuring)

  • backends/graphics/sdl/sdl-graphics.cpp

     
    10301030                _dirtyRectList[0].y = 0;
    10311031                _dirtyRectList[0].w = width;
    10321032                _dirtyRectList[0].h = height;
     1033                _dirtyArea = width * height;
    10331034        }
    10341035
    10351036        // Only draw anything if necessary
     
    11081109        }
    11091110
    11101111        _numDirtyRects = 0;
     1112        _dirtyArea = 0;
    11111113        _forceFull = false;
    11121114        _mouseNeedsRedraw = false;
    11131115}
     
    13021304                return;
    13031305        }
    13041306
     1307        _dirtyArea += (w * h);
     1308        if (_dirtyArea > width * height) {
     1309                _forceFull = true;
     1310                return;
     1311        }
     1312
    13051313        if (w > 0 && h > 0) {
    13061314                SDL_Rect *r = &_dirtyRectList[_numDirtyRects++];
    13071315
  • backends/graphics/sdl/sdl-graphics.h

     
    235235        // Dirty rect management
    236236        SDL_Rect _dirtyRectList[NUM_DIRTY_RECT];
    237237        int _numDirtyRects;
     238        int32 _dirtyArea;
    238239
    239240        struct MousePos {
    240241                // The mouse position, using either virtual (game) or real