[Scummvm-cvs-logs] CVS: scummvm/backends/morphos morphos.cpp,1.2,1.3 morphos.h,1.2,1.3
Ruediger Hanke
tomjoad at users.sourceforge.net
Sat Aug 31 16:00:01 CEST 2002
Update of /cvsroot/scummvm/scummvm/backends/morphos
In directory usw-pr-cvs1:/tmp/cvs-serv24828
Modified Files:
morphos.cpp morphos.h
Log Message:
Limit number of update rects to keep
Index: morphos.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/morphos/morphos.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- morphos.cpp 22 Aug 2002 12:09:06 -0000 1.2
+++ morphos.cpp 31 Aug 2002 22:59:26 -0000 1.3
@@ -115,6 +115,7 @@
ScreenChanged = false;
DirtyBlocks = NULL;
BlockColors = NULL;
+ UpdateRects = 0;
Scaler = NULL;
FullScreenMode = full_screen;
CDrive = NULL;
@@ -928,6 +929,9 @@
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 @@
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 @@
ScreenChanged = false;
memset(DirtyBlocks, 0, BLOCKS_X*BLOCKS_Y*sizeof (bool));
+ UpdateRects = 0;
}
void OSystem_MorphOS::DrawMouse()
Index: morphos.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/morphos/morphos.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- morphos.h 22 Aug 2002 12:09:06 -0000 1.2
+++ morphos.h 31 Aug 2002 22:59:26 -0000 1.3
@@ -152,6 +152,7 @@
bool *DirtyBlocks;
Region *UpdateRegion;
Region *NewUpdateRegion;
+ ULONG UpdateRects;
/* Sound-related attributes */
Process *ScummMusicThread;
More information about the Scummvm-git-logs
mailing list