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

yazoo at users.sourceforge.net yazoo at users.sourceforge.net
Mon Dec 24 17:57:14 CET 2007


Revision: 29979
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29979&view=rev
Author:   yazoo
Date:     2007-12-24 08:57:14 -0800 (Mon, 24 Dec 2007)

Log Message:
-----------
Fix background save/restore

Modified Paths:
--------------
    scummvm/trunk/engines/cruise/cruise_main.cpp
    scummvm/trunk/engines/cruise/font.cpp
    scummvm/trunk/engines/cruise/function.cpp
    scummvm/trunk/engines/cruise/mainDraw.cpp
    scummvm/trunk/engines/cruise/saveload.cpp
    scummvm/trunk/engines/cruise/vars.cpp
    scummvm/trunk/engines/cruise/vars.h

Modified: scummvm/trunk/engines/cruise/cruise_main.cpp
===================================================================
--- scummvm/trunk/engines/cruise/cruise_main.cpp	2007-12-24 16:00:20 UTC (rev 29978)
+++ scummvm/trunk/engines/cruise/cruise_main.cpp	2007-12-24 16:57:14 UTC (rev 29979)
@@ -440,7 +440,7 @@
 	initOverlayTable();
 
 	stateID = 0;
-	currentActiveBackgroundPlane = 0;
+	masterScreen = 0;
 
 	freeDisk();
 
@@ -1266,11 +1266,11 @@
 
 				if(currentScriptPtr)
 				{
-					createTextObject(&cellHead, ovlIdx, pHeader->id, x, y, 200, findHighColor(), currentActiveBackgroundPlane, currentScriptPtr->overlayNumber, currentScriptPtr->scriptNumber);
+					createTextObject(&cellHead, ovlIdx, pHeader->id, x, y, 200, findHighColor(), masterScreen, currentScriptPtr->overlayNumber, currentScriptPtr->scriptNumber);
 				}
 				else
 				{
-					createTextObject(&cellHead, ovlIdx, pHeader->id, x, y, 200, findHighColor(), currentActiveBackgroundPlane, 0, 0);
+					createTextObject(&cellHead, ovlIdx, pHeader->id, x, y, 200, findHighColor(), masterScreen, 0, 0);
 				}
 				
 				userWait = 1;
@@ -1882,7 +1882,7 @@
 						userEnabled = false;
 					}
 				} else if (autoMsg != -1) {
-					removeCell(&cellHead, autoOvl, autoMsg, 5, currentActiveBackgroundPlane );
+					removeCell(&cellHead, autoOvl, autoMsg, 5, masterScreen );
 					autoMsg = -1;
 				}
 			}

Modified: scummvm/trunk/engines/cruise/font.cpp
===================================================================
--- scummvm/trunk/engines/cruise/font.cpp	2007-12-24 16:00:20 UTC (rev 29978)
+++ scummvm/trunk/engines/cruise/font.cpp	2007-12-24 16:57:14 UTC (rev 29979)
@@ -186,7 +186,7 @@
 	fadeFlag = 0;
 	scroll = 0;
 	switchPal = 0;
-	currentActiveBackgroundPlane = 0;
+	masterScreen = 0;
 
 	changeCursor(CURSOR_NORMAL);
 

Modified: scummvm/trunk/engines/cruise/function.cpp
===================================================================
--- scummvm/trunk/engines/cruise/function.cpp	2007-12-24 16:00:20 UTC (rev 29978)
+++ scummvm/trunk/engines/cruise/function.cpp	2007-12-24 16:57:14 UTC (rev 29979)
@@ -273,7 +273,7 @@
 		overlay = currentScriptPtr->overlayNumber;
 	}
 
-	removeCell(&cellHead, overlay, idx, 5, currentActiveBackgroundPlane);
+	removeCell(&cellHead, overlay, idx, 5, masterScreen);
 
 	return (0);
 }
@@ -538,16 +538,16 @@
 	for(long int i=0; i< 256; i+=32) {
 		for(long int j=0; j<256; j++) {
 			int offsetTable[3];
-			offsetTable[0] = -i;
-			offsetTable[1] = -i;
-			offsetTable[2] = -i;
+			offsetTable[0] = -32;
+			offsetTable[1] = -32;
+			offsetTable[2] = -32;
 			calcRGB(&workpal[3*j], &workpal[3*j], offsetTable);
 		}
 		gfxModuleData_setPal256(workpal);
 		gfxModuleData_flipScreen();
 	}
 
-	//gfxModuleData_gfxClearFrameBuffer(backgroundPtrtable[currentActiveBackgroundPlane]);
+	//gfxModuleData_gfxClearFrameBuffer(backgroundPtrtable[masterScreen]);
 
 	fadeFlag = 1;
 	PCFadeFlag = 1;
@@ -631,7 +631,7 @@
 	if (!overlayIdx)
 		overlayIdx = currentScriptPtr->overlayNumber;
 
-	addCell(&cellHead, overlayIdx, objIdx, objType, currentActiveBackgroundPlane, currentScriptPtr->overlayNumber, currentScriptPtr->scriptNumber, currentScriptPtr->type);
+	addCell(&cellHead, overlayIdx, objIdx, objType, masterScreen, currentScriptPtr->overlayNumber, currentScriptPtr->scriptNumber, currentScriptPtr->type);
 
 	return 0;
 }
@@ -645,7 +645,7 @@
 	if (!overlayIdx)
 		overlayIdx = currentScriptPtr->overlayNumber;
 
-	addBackgroundIncrust(overlayIdx, objIdx, &backgroundIncrustHead, currentScriptPtr->scriptNumber, currentScriptPtr->overlayNumber, currentActiveBackgroundPlane, objType);
+	addBackgroundIncrust(overlayIdx, objIdx, &backgroundIncrustHead, currentScriptPtr->scriptNumber, currentScriptPtr->overlayNumber, masterScreen, objType);
 
 	return 0;
 }
@@ -659,7 +659,7 @@
 		ovlNumber = currentScriptPtr->overlayNumber;
 	}
 
-	removeCell(&cellHead, ovlNumber, objectIdx, objType, currentActiveBackgroundPlane);
+	removeCell(&cellHead, ovlNumber, objectIdx, objType, masterScreen);
 
 	return 0;
 }
@@ -714,7 +714,7 @@
 		}
 	}
 
-	createTextObject(&cellHead, overlayIdx, var_8, var_6, var_4, var_2, color, currentActiveBackgroundPlane, currentScriptPtr->overlayNumber, currentScriptPtr->scriptNumber);
+	createTextObject(&cellHead, overlayIdx, var_8, var_6, var_4, var_2, color, masterScreen, currentScriptPtr->overlayNumber, currentScriptPtr->scriptNumber);
 
 	return 0;
 }
@@ -770,7 +770,7 @@
 	if (!overlay)
 		overlay = currentScriptPtr->overlayNumber;
 
-	pObject = addCell(&cellHead, overlay, obj, 4, currentActiveBackgroundPlane, currentScriptPtr->overlayNumber, currentScriptPtr->scriptNumber, currentScriptPtr->type);
+	pObject = addCell(&cellHead, overlay, obj, 4, masterScreen, currentScriptPtr->overlayNumber, currentScriptPtr->scriptNumber, currentScriptPtr->type);
 
 	if (!pObject)
 		return 0;
@@ -822,12 +822,12 @@
 }
 
 int16 Op_SetActiveBackground(void) {
-	int currentPlane = currentActiveBackgroundPlane;
+	int currentPlane = masterScreen;
 	int newPlane = popVar();
 
 	if (newPlane >= 0 && newPlane < 8) {
 		if (backgroundPtrtable[newPlane]) {
-			currentActiveBackgroundPlane = newPlane;
+			masterScreen = newPlane;
 			switchPal = 1;
 		}
 	}
@@ -842,8 +842,8 @@
 		if(backgroundPtrtable[backgroundIdx])
 			free(backgroundPtrtable[backgroundIdx]);
 
-		if(currentActiveBackgroundPlane == backgroundIdx)
-			currentActiveBackgroundPlane = 0;
+		if(masterScreen == backgroundIdx)
+			masterScreen = 0;
 
 		strcpy(backgroundTable[backgroundIdx].name, "");
 	}
@@ -1258,24 +1258,31 @@
 }
 
 int16 Op_BgName(void) {
-	popPtr();
-	popVar();
+	char* bgName = (char*)popPtr();
+	int bgIdx = popVar();
 
-	printf("Partial op 5C\n");
+	if((bgIdx >= 0) && (bgIdx < 8) && bgName) {
+		strcpy(bgName, backgroundTable[bgIdx].name);
 
+		if(strlen(bgName))
+			return 1;
+
+		return 0;
+	}
+
 	return 0;
 }
 
 int16 Op_StopFX(void) {
-	popVar();
+	int fxIdx = popVar();
 
-	printf("Partial op 5E (sound related)\n");
+	printf("StopFX(%d)\n", fxIdx);
 
 	return 0;
 }
 
 int16 Op_PlaySong(void) {
-	printf("Partial op 3E (sound related)\n");
+	printf("PlaySong()\n");
 
 	return 0;
 }
@@ -1295,12 +1302,12 @@
 }
 
 int16 Op_FadeSong(void) {
-	printf("Partial op 3F (sound related)\n");
+	printf("FadeSong()\n");
 	return 0;
 }
 
 int16 Op_FreeSong(void) {
-	printf("Partial op 40 (sound related)\n");
+	printf("FreeSong()\n");
 	//freeStuff1();
 	freeStuff2();
 

Modified: scummvm/trunk/engines/cruise/mainDraw.cpp
===================================================================
--- scummvm/trunk/engines/cruise/mainDraw.cpp	2007-12-24 16:00:20 UTC (rev 29978)
+++ scummvm/trunk/engines/cruise/mainDraw.cpp	2007-12-24 16:57:14 UTC (rev 29979)
@@ -103,7 +103,7 @@
 			offsetTable[0] = -i;
 			offsetTable[1] = -i;
 			offsetTable[2] = -i;
-			calcRGB(&palScreen[currentActiveBackgroundPlane][3*j], &workpal[3*j], offsetTable);
+			calcRGB(&palScreen[masterScreen][3*j], &workpal[3*j], offsetTable);
 		}
 		gfxModuleData_setPal256(workpal);
 		gfxModuleData_flipScreen();
@@ -114,7 +114,7 @@
 		offsetTable[0] = 0;
 		offsetTable[1] = 0;
 		offsetTable[2] = 0;
-		calcRGB(&palScreen[currentActiveBackgroundPlane][3*j], &workpal[3*j], offsetTable);
+		calcRGB(&palScreen[masterScreen][3*j], &workpal[3*j], offsetTable);
 	}
 
 	gfxModuleData_setPal256(workpal);
@@ -1392,7 +1392,7 @@
 		return;
 	}
 
-	bgPtr = backgroundPtrtable[currentActiveBackgroundPlane];
+	bgPtr = backgroundPtrtable[masterScreen];
 
 	if (bgPtr) {
 		gfxModuleData_gfxCopyScreen((char *)bgPtr, (char *)gfxModuleData.pPage10);
@@ -1410,7 +1410,7 @@
 	//-------------------------------------------------- PROCESS SPRITES -----------------------------------------//
 
 	while (currentObjPtr) {
-		if ((currentActiveBackgroundPlane == currentObjPtr->backgroundPlane) && (currentObjPtr->freeze == 0) && (currentObjPtr->type == OBJ_TYPE_SPRITE)) {
+		if ((masterScreen == currentObjPtr->backgroundPlane) && (currentObjPtr->freeze == 0) && (currentObjPtr->type == OBJ_TYPE_SPRITE)) {
 			objectParamsQuery params;
 
 			currentObjIdx = currentObjPtr->idx;

Modified: scummvm/trunk/engines/cruise/saveload.cpp
===================================================================
--- scummvm/trunk/engines/cruise/saveload.cpp	2007-12-24 16:00:20 UTC (rev 29978)
+++ scummvm/trunk/engines/cruise/saveload.cpp	2007-12-24 16:57:14 UTC (rev 29979)
@@ -103,7 +103,7 @@
 	initOverlayTable();
 
 	stateID = 0;
-	currentActiveBackgroundPlane = 0;
+	masterScreen = 0;
 
 	freeDisk();
 
@@ -537,7 +537,7 @@
 	else
 		currentSaveFile->writeSint16LE(0);
 
-	currentSaveFile->writeSint16LE(currentActiveBackgroundPlane);
+	currentSaveFile->writeSint16LE(masterScreen);
 	currentSaveFile->writeSint16LE(switchPal);
 	currentSaveFile->writeSint16LE(scroll);
 	currentSaveFile->writeSint16LE(fadeFlag);
@@ -714,7 +714,7 @@
 	else
 		animationStart = false;
 
-	currentActiveBackgroundPlane = currentSaveFile->readSint16LE();
+	masterScreen = currentSaveFile->readSint16LE();
 	switchPal = currentSaveFile->readSint16LE();
 	scroll = currentSaveFile->readSint16LE();
 	fadeFlag = currentSaveFile->readSint16LE();

Modified: scummvm/trunk/engines/cruise/vars.cpp
===================================================================
--- scummvm/trunk/engines/cruise/vars.cpp	2007-12-24 16:00:20 UTC (rev 29978)
+++ scummvm/trunk/engines/cruise/vars.cpp	2007-12-24 16:57:14 UTC (rev 29979)
@@ -39,7 +39,7 @@
 int16 switchPal;
 char cmdLine[90];
 
-int16 currentActiveBackgroundPlane;
+int16 masterScreen;
 int16 doFade;
 int16 fadeFlag = 0;
 

Modified: scummvm/trunk/engines/cruise/vars.h
===================================================================
--- scummvm/trunk/engines/cruise/vars.h	2007-12-24 16:00:20 UTC (rev 29978)
+++ scummvm/trunk/engines/cruise/vars.h	2007-12-24 16:57:14 UTC (rev 29979)
@@ -67,7 +67,7 @@
 extern int16 switchPal;
 extern char cmdLine[90];
 
-extern int16 currentActiveBackgroundPlane;
+extern int16 masterScreen;
 extern int16 doFade;
 extern int16 fadeFlag;
 


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