aboutsummaryrefslogtreecommitdiff
path: root/engines/cruise
diff options
context:
space:
mode:
authorPaul Gilbert2009-02-19 09:58:33 +0000
committerPaul Gilbert2009-02-19 09:58:33 +0000
commitb2c0f6181701f55ba4ae90ab21f451f2d848b6bd (patch)
treeb8a3d5b1168ed7a5a098c0ed6a485fe961fff4f3 /engines/cruise
parent935e748e624b307647208c7072bd6a8c8424cf08 (diff)
downloadscummvm-rg350-b2c0f6181701f55ba4ae90ab21f451f2d848b6bd.tar.gz
scummvm-rg350-b2c0f6181701f55ba4ae90ab21f451f2d848b6bd.tar.bz2
scummvm-rg350-b2c0f6181701f55ba4ae90ab21f451f2d848b6bd.zip
Initial work on correct engine pausing
svn-id: r38541
Diffstat (limited to 'engines/cruise')
-rw-r--r--engines/cruise/cruise_main.cpp52
-rw-r--r--engines/cruise/cruise_main.h1
-rw-r--r--engines/cruise/gfxModule.cpp7
-rw-r--r--engines/cruise/gfxModule.h1
4 files changed, 35 insertions, 26 deletions
diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp
index f44eef6413..04e6a2167d 100644
--- a/engines/cruise/cruise_main.cpp
+++ b/engines/cruise/cruise_main.cpp
@@ -38,17 +38,6 @@ unsigned int timer = 0;
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 @@ void resetRaster(uint8 *rasterPtr, int32 rasterSize) {
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 @@ void closeAllMenu(void) {
}
int processInput(void) {
+ static bool pausedButtonDown = false;
int16 mouseX = 0;
int16 mouseY = 0;
int16 button = 0;
@@ -1332,7 +1310,30 @@ int processInput(void) {
// 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 @@ int processInput(void) {
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 @@ int processInput(void) {
buttonDown = 1;
}
}
+
return 0;
}
diff --git a/engines/cruise/cruise_main.h b/engines/cruise/cruise_main.h
index b818c31506..955f8c9ad9 100644
--- a/engines/cruise/cruise_main.h
+++ b/engines/cruise/cruise_main.h
@@ -109,7 +109,6 @@ void resetFileEntryRange(int param1, int param2);
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);
diff --git a/engines/cruise/gfxModule.cpp b/engines/cruise/gfxModule.cpp
index 400192636a..e46ea0da54 100644
--- a/engines/cruise/gfxModule.cpp
+++ b/engines/cruise/gfxModule.cpp
@@ -264,4 +264,11 @@ void flip() {
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
diff --git a/engines/cruise/gfxModule.h b/engines/cruise/gfxModule.h
index e8fa0a6799..7a48d4c2fc 100644
--- a/engines/cruise/gfxModule.h
+++ b/engines/cruise/gfxModule.h
@@ -62,6 +62,7 @@ void gfxModuleData_flipScreen(void);
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