[Scummvm-cvs-logs] CVS: scummvm/bs2 build_display.cpp,1.13,1.14

Torbj?rn Andersson eriktorbjorn at users.sourceforge.net
Thu Aug 28 23:43:04 CEST 2003


Update of /cvsroot/scummvm/scummvm/bs2
In directory sc8-pr-cvs1:/tmp/cvs-serv10958

Modified Files:
	build_display.cpp 
Log Message:
Added some code to stop producing interpolation frames if the scene has
already reached its scroll target. This keeps BS2 from using all available
CPU time all of the time.

It may still be that we need a mechanism for throttling the frame rate when
the scene is moving towards a scroll target, but my computer isn't really
fast enough to test that.

Two other bugs fixed in the process:

* I think the last frame of the render cycle was rendered, but not
  displayed. If so, that should be fixed now.

* I discovered that there are cases where we do need to clear the screen
  (e.g. at the "Meanwhile..." message when George has found out about the
  Glease Gallery), so I've re-enabled the function and disabled it in the
  render cycle.


Index: build_display.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/build_display.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- build_display.cpp	28 Aug 2003 12:26:28 -0000	1.13
+++ build_display.cpp	29 Aug 2003 06:42:34 -0000	1.14
@@ -157,8 +157,10 @@
 			//----------------------------------------------------
 			// clear the back buffer, before building up the new screen
 			// from the back forwards
-	
-			EraseBackBuffer();
+
+			// FIXME: I'm not convinced that this is needed. Isn't
+			// the whole screen redrawn each time?
+			// EraseBackBuffer();
 
 			//----------------------------------------------------
 			// first background parallax + related anims
@@ -253,7 +255,8 @@
  			//----------------------------------------------------
 			// ready - blit to screen
 
-			CopyScreenBuffer();
+			if (ServiceWindows() == RDERR_APPCLOSED)	// if the game is being shut down, drop out
+				break;
 
  			//----------------------------------------------------
 			// update our fps reading
@@ -262,7 +265,7 @@
 			if (SVM_timeGetTime() > cycleTime)
 			{
 				fps = frameCount;
-				debug(2, "FPS: %d", fps);
+				debug(0, "FPS: %d", fps);
 				frameCount = 0;
 				cycleTime = SVM_timeGetTime()+1000;
 			}
@@ -270,15 +273,9 @@
 			// check if we've got time to render the screen again this cycle
 			// (so drivers can smooth out the scrolling in between normal game cycles)
 
-			// FIXME: If we have already reached the scroll target,
-			// we should sleep for the rest of the render cycle.
-
 			EndRenderCycle(&end);
 
 			if (end)	// if we haven't got time to render again this cycle, drop out of 'render cycle' while-loop
-				break;
-
-			if (ServiceWindows() == RDERR_APPCLOSED)	// if the game is being shut down, drop out
 				break;
 
 			//----------------------------------------------------





More information about the Scummvm-git-logs mailing list