[Scummvm-cvs-logs] SF.net SVN: scummvm:[44536] scummvm/trunk/engines/cruise

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Fri Oct 2 15:13:48 CEST 2009


Revision: 44536
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44536&view=rev
Author:   dreammaster
Date:     2009-10-02 13:13:47 +0000 (Fri, 02 Oct 2009)

Log Message:
-----------
Bugfix for dirty rects getting lost during room fade-ins

Modified Paths:
--------------
    scummvm/trunk/engines/cruise/gfxModule.cpp
    scummvm/trunk/engines/cruise/gfxModule.h
    scummvm/trunk/engines/cruise/mainDraw.cpp

Modified: scummvm/trunk/engines/cruise/gfxModule.cpp
===================================================================
--- scummvm/trunk/engines/cruise/gfxModule.cpp	2009-10-02 13:11:56 UTC (rev 44535)
+++ scummvm/trunk/engines/cruise/gfxModule.cpp	2009-10-02 13:13:47 UTC (rev 44536)
@@ -276,13 +276,11 @@
 	}
 }
 
-void flip() {
-	RectList::iterator dr;
-	int i;
+void gfxModuleData_updatePalette() {
 	byte paletteRGBA[256 * 4];
 
 	if (palDirtyMax != -1) {
-		for (i = palDirtyMin; i <= palDirtyMax; i++) {
+		for (int i = palDirtyMin; i <= palDirtyMax; i++) {
 			paletteRGBA[i * 4 + 0] = lpalette[i].R;
 			paletteRGBA[i * 4 + 1] = lpalette[i].G;
 			paletteRGBA[i * 4 + 2] = lpalette[i].B;
@@ -292,7 +290,19 @@
 		palDirtyMin = 256;
 		palDirtyMax = -1;
 	}
+}
 
+void gfxModuleData_updateScreen() {
+	g_system->updateScreen();
+	g_system->delayMillis(20);
+}
+
+void flip() {
+	RectList::iterator dr;
+
+	// Update the palette
+	gfxModuleData_updatePalette();
+
 	// Make a copy of the prior frame's dirty rects, and then backup the current frame's rects
 	RectList tempList = _priorFrameRects;
 	_priorFrameRects = _dirtyRects;

Modified: scummvm/trunk/engines/cruise/gfxModule.h
===================================================================
--- scummvm/trunk/engines/cruise/gfxModule.h	2009-10-02 13:11:56 UTC (rev 44535)
+++ scummvm/trunk/engines/cruise/gfxModule.h	2009-10-02 13:13:47 UTC (rev 44536)
@@ -52,6 +52,9 @@
 void gfxModuleData_field_90(void);
 void gfxModuleData_gfxWaitVSync(void);
 void gfxModuleData_flip(void);
+void gfxModuleData_updatePalette();
+void gfxModuleData_updateScreen();
+
 void gfxCopyRect(const uint8 *sourceBuffer, int width, int height, byte *dest, int x, int y, int colour);
 void gfxModuleData_gfxCopyScreen(const uint8 *sourcePtr, uint8 *destPtr);
 void convertGfxFromMode4(const uint8 *sourcePtr, int width, int height, uint8 *destPtr);

Modified: scummvm/trunk/engines/cruise/mainDraw.cpp
===================================================================
--- scummvm/trunk/engines/cruise/mainDraw.cpp	2009-10-02 13:11:56 UTC (rev 44535)
+++ scummvm/trunk/engines/cruise/mainDraw.cpp	2009-10-02 13:13:47 UTC (rev 44536)
@@ -107,7 +107,9 @@
 			calcRGB(&palScreen[masterScreen][3*j], &workpal[3*j], offsetTable);
 		}
 		gfxModuleData_setPal256(workpal);
-		gfxModuleData_flipScreen();
+
+		gfxModuleData_updatePalette();
+		gfxModuleData_updateScreen();
 	}
 
 	for (long int j = 0; j < 256; j++) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list