diff options
author | Ruediger Hanke | 2002-08-31 22:59:26 +0000 |
---|---|---|
committer | Ruediger Hanke | 2002-08-31 22:59:26 +0000 |
commit | 79c1f284b72096768515a2ba39ce8dea45193a34 (patch) | |
tree | 349d0fccbf78e4ff54fc32b84304e8d19827ed21 /backends/morphos/morphos.cpp | |
parent | 93b630dcfe687a874f0933d5bcbbf94daa426696 (diff) | |
download | scummvm-rg350-79c1f284b72096768515a2ba39ce8dea45193a34.tar.gz scummvm-rg350-79c1f284b72096768515a2ba39ce8dea45193a34.tar.bz2 scummvm-rg350-79c1f284b72096768515a2ba39ce8dea45193a34.zip |
Limit number of update rects to keep
svn-id: r4891
Diffstat (limited to 'backends/morphos/morphos.cpp')
-rw-r--r-- | backends/morphos/morphos.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/backends/morphos/morphos.cpp b/backends/morphos/morphos.cpp index 0c2e9a7fce..22390b634e 100644 --- a/backends/morphos/morphos.cpp +++ b/backends/morphos/morphos.cpp @@ -115,6 +115,7 @@ OSystem_MorphOS::OSystem_MorphOS(int game_id, SCALERTYPE gfx_mode, bool full_scr ScreenChanged = false; DirtyBlocks = NULL; BlockColors = NULL; + UpdateRects = 0; Scaler = NULL; FullScreenMode = full_screen; CDrive = NULL; @@ -928,6 +929,9 @@ void OSystem_MorphOS::copy_rect(const byte *src, int pitch, int x, int y, int w, bool OSystem_MorphOS::AddUpdateRect(WORD x, WORD y, WORD w, WORD h) { + if (UpdateRects > 20) + return false; + if (x < 0) { w+=x; x = 0; } if (y < 0) { h+=y; y = 0; } if (w >= ScummBufferWidth-x) { w = ScummBufferWidth - x; } @@ -936,6 +940,12 @@ bool OSystem_MorphOS::AddUpdateRect(WORD x, WORD y, WORD w, WORD h) if (w <= 0 || h <= 0) return false; + if (++UpdateRects > 25) + { + x = 0; y = 0; + w = ScummBufferWidth; h = ScummBufferHeight; + } + Rectangle update_rect = { x, y, x+w, y+h }; OrRectRegion(NewUpdateRegion, &update_rect); ScreenChanged = true; @@ -1088,6 +1098,7 @@ void OSystem_MorphOS::update_screen() ScreenChanged = false; memset(DirtyBlocks, 0, BLOCKS_X*BLOCKS_Y*sizeof (bool)); + UpdateRects = 0; } void OSystem_MorphOS::DrawMouse() |