diff options
| -rw-r--r-- | backends/morphos/morphos.cpp | 11 | ||||
| -rw-r--r-- | backends/morphos/morphos.h | 1 |
2 files changed, 12 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() diff --git a/backends/morphos/morphos.h b/backends/morphos/morphos.h index d89c2e7371..aead0c3aec 100644 --- a/backends/morphos/morphos.h +++ b/backends/morphos/morphos.h @@ -152,6 +152,7 @@ class OSystem_MorphOS : public OSystem bool *DirtyBlocks; Region *UpdateRegion; Region *NewUpdateRegion; + ULONG UpdateRects; /* Sound-related attributes */ Process *ScummMusicThread; |
