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

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Thu Feb 19 10:58:33 CET 2009


Revision: 38541
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38541&view=rev
Author:   dreammaster
Date:     2009-02-19 09:58:33 +0000 (Thu, 19 Feb 2009)

Log Message:
-----------
Initial work on correct engine pausing

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

Modified: scummvm/trunk/engines/cruise/cruise_main.cpp
===================================================================
--- scummvm/trunk/engines/cruise/cruise_main.cpp	2009-02-19 09:57:39 UTC (rev 38540)
+++ scummvm/trunk/engines/cruise/cruise_main.cpp	2009-02-19 09:58:33 UTC (rev 38541)
@@ -38,17 +38,6 @@
 
 gfxEntryStruct* linkedMsgList = NULL;
 
-void drawSolidBox(int32 x1, int32 y1, int32 x2, int32 y2, uint8 color) {
-	int32 i;
-	int32 j;
-
-	for (i = x1; i < x2; i++) {
-		for (j = y1; j < y2; j++) {
-			globalScreen[j * 320 + i] = color;
-		}
-	}
-}
-
 void drawBlackSolidBoxSmall() {
 //  gfxModuleData.drawSolidBox(64,100,256,117,0);
 	drawSolidBox(64, 100, 256, 117, 0);
@@ -58,18 +47,6 @@
 	memset(rasterPtr, 0, rasterSize);
 }
 
-void drawInfoStringSmallBlackBox(const char *s) {
-	gfxModuleData_field_90();
-	gfxModuleData_gfxWaitVSync();
-	drawBlackSolidBoxSmall();
-
-	drawString(10, 100, (const uint8 *)s, gfxModuleData.pPage10, titleColor, 300);
-
-	gfxModuleData_flip();
-
-	flipScreen();
-}
-
 void loadPakedFileToMem(int fileIdx, uint8 *buffer) {
 	changeCursor(CURSOR_DISK);
 
@@ -1290,6 +1267,7 @@
 }
 
 int processInput(void) {
+	static bool pausedButtonDown = false;
 	int16 mouseX = 0;
 	int16 mouseY = 0;
 	int16 button = 0;
@@ -1332,7 +1310,30 @@
 
 	// Check for Pause 'P' key
 	if (keyboardCode == Common::KEYCODE_p) {
-		drawInfoStringSmallBlackBox(_vm->langString(ID_PAUSED));
+		keyboardCode = Common::KEYCODE_INVALID;
+		_vm->pauseEngine(true);
+
+		while (!_vm->shouldQuit()) {
+			getMouseStatus(&main10, &mouseX, &button, &mouseY);
+
+			if (button) pausedButtonDown = true;
+			else if (pausedButtonDown)
+				// Button released, so exit pause
+				break;
+			else if (keyboardCode != Common::KEYCODE_INVALID)
+				break;
+
+			g_system->delayMillis(10);
+		}
+
+		if (keyboardCode == Common::KEYCODE_x)
+			// Exit the game
+			return 1;
+
+		keyboardCode = Common::KEYCODE_INVALID;
+		pausedButtonDown = false;
+		_vm->pauseEngine(false);
+		return 0;
 	}
 
 	if (!userEnabled) {
@@ -1488,7 +1489,7 @@
 							strcpy(text, menuTable[0]->stringPtr);
 							strcat(text, ":");
 							strcat(text, currentMenuElement->string);
-							linkedMsgList = renderText(320, (const uint8 *)text);
+							linkedMsgList = renderText(320, (const char *)text);
 							changeCursor(CURSOR_CROSS);
 						}
 					}
@@ -1534,6 +1535,7 @@
 			buttonDown = 1;
 		}
 	}
+
 	return 0;
 }
 

Modified: scummvm/trunk/engines/cruise/cruise_main.h
===================================================================
--- scummvm/trunk/engines/cruise/cruise_main.h	2009-02-19 09:57:39 UTC (rev 38540)
+++ scummvm/trunk/engines/cruise/cruise_main.h	2009-02-19 09:58:33 UTC (rev 38541)
@@ -109,7 +109,6 @@
 int getProcParam(int overlayIdx, int param2, const char * name);
 void changeScriptParamInList(int param1, int param2, scriptInstanceStruct * pScriptInstance, int newValue, int param3);
 uint8 *getDataFromData3(ovlData3Struct * ptr, int param);
-int32 prepareWordRender(int32 param, int32 var1, int16 * out2, uint8 * ptr3, const uint8 * string);
 void removeExtention(const char *name, char *buffer);
 void resetRaster(uint8 * rasterPtr, int32 rasterSize);
 void resetPtr2(scriptInstanceStruct * ptr);

Modified: scummvm/trunk/engines/cruise/gfxModule.cpp
===================================================================
--- scummvm/trunk/engines/cruise/gfxModule.cpp	2009-02-19 09:57:39 UTC (rev 38540)
+++ scummvm/trunk/engines/cruise/gfxModule.cpp	2009-02-19 09:58:33 UTC (rev 38541)
@@ -264,4 +264,11 @@
 	lastTick = g_system->getMillis();
 }
 
+void drawSolidBox(int32 x1, int32 y1, int32 x2, int32 y2, uint8 colour) {
+	for (int y = y1; y < y2; ++y) {
+		byte *p = &gfxModuleData.pPage00[y * 320 + x1];
+		Common::set_to(p, p + (x2 - x1), colour);
+	}
+}
+
 } // End of namespace Cruise

Modified: scummvm/trunk/engines/cruise/gfxModule.h
===================================================================
--- scummvm/trunk/engines/cruise/gfxModule.h	2009-02-19 09:57:39 UTC (rev 38540)
+++ scummvm/trunk/engines/cruise/gfxModule.h	2009-02-19 09:58:33 UTC (rev 38541)
@@ -62,6 +62,7 @@
 void gfxModuleData_convertOldPalColor(uint16 oldColor, uint8* pOutput);
 void gfxModuleData_setPal256(uint8 * ptr);
 void flip(void);
+void drawSolidBox(int32 x1, int32 y1, int32 x2, int32 y2, uint8 colour);
 
 } // End of namespace Cruise
 


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