aboutsummaryrefslogtreecommitdiff
path: root/engines/cruise
diff options
context:
space:
mode:
authorPaul Gilbert2009-06-05 12:20:42 +0000
committerPaul Gilbert2009-06-05 12:20:42 +0000
commit862d1cf42b9d9ce61c1bcf52aa2f7efe75d5249f (patch)
tree207cbe4de3d1daaffa2db4d301d166b57c1e3e44 /engines/cruise
parent58d494a7cb11c97834c61f6596d38c1c71c57031 (diff)
downloadscummvm-rg350-862d1cf42b9d9ce61c1bcf52aa2f7efe75d5249f.tar.gz
scummvm-rg350-862d1cf42b9d9ce61c1bcf52aa2f7efe75d5249f.tar.bz2
scummvm-rg350-862d1cf42b9d9ce61c1bcf52aa2f7efe75d5249f.zip
Tweaks to the code that pauses for a mouse press when displaying many text messages
svn-id: r41196
Diffstat (limited to 'engines/cruise')
-rw-r--r--engines/cruise/cruise_main.cpp44
-rw-r--r--engines/cruise/gfxModule.cpp7
2 files changed, 36 insertions, 15 deletions
diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp
index bdbf257b32..649cc72cb8 100644
--- a/engines/cruise/cruise_main.cpp
+++ b/engines/cruise/cruise_main.cpp
@@ -40,6 +40,8 @@ unsigned int timer = 0;
gfxEntryStruct* linkedMsgList = NULL;
+extern bool isBlack;
+
void drawBlackSolidBoxSmall() {
// gfxModuleData.drawSolidBox(64,100,256,117,0);
drawSolidBox(64, 100, 256, 117, 0);
@@ -1712,6 +1714,8 @@ void CruiseEngine::mainLoop(void) {
//int32 t_start,t_left;
//uint32 t_end;
//int32 q=0; /* Dummy */
+ int16 mouseX, mouseY;
+ int16 mouseButton;
int enableUser = 0;
@@ -1793,13 +1797,15 @@ void CruiseEngine::mainLoop(void) {
enableUser = 0;
}
- manageScripts(&relHead);
- manageScripts(&procHead);
+ if (userWait < 1) {
+ manageScripts(&relHead);
+ manageScripts(&procHead);
- removeFinishedScripts(&relHead);
- removeFinishedScripts(&procHead);
+ removeFinishedScripts(&relHead);
+ removeFinishedScripts(&procHead);
- processAnimation();
+ processAnimation();
+ }
if (remdo) {
// ASSERT(0);
@@ -1824,17 +1830,13 @@ void CruiseEngine::mainLoop(void) {
PCFadeFlag = 0;
/*if (!PCFadeFlag)*/
- if (userWait != 2) {
+ if (!isUserWait) {
mainDraw(0);
flipScreen();
}
if (userEnabled && !userWait && !autoTrack) {
if (currentActiveMenu == -1) {
- int16 mouseX;
- int16 mouseY;
- int16 mouseButton;
-
static int16 oldMouseX = -1;
static int16 oldMouseY = -1;
@@ -1869,9 +1871,14 @@ void CruiseEngine::mainLoop(void) {
// User Wait handling
if (userWait == 1) {
// Initial step
+ do {
+ // Make sure any previous mouse press is released
+ getMouseStatus(&main10, &mouseX, &mouseButton, &mouseY);
+ } while (mouseButton != 0);
+
++userWait;
- mainDraw(0);
- flipScreen();
+// mainDraw(0);
+// flipScreen();
} else {
// Standard handling
@@ -1881,9 +1888,16 @@ void CruiseEngine::mainLoop(void) {
removeFinishedScripts(&relHead);
removeFinishedScripts(&procHead);
- // Draw the next screen
- processAnimation();
- gfxModuleData_flipScreen();
+ if (isBlack) {
+ // This is a bit of a hack to ensure that user waits directly after a palette fade
+ // have time to restore the palette before waiting starts
+ mainDraw(0);
+ flipScreen();
+ } else {
+ // Draw the next screen
+ processAnimation();
+ gfxModuleData_flipScreen();
+ }
}
continue;
}
diff --git a/engines/cruise/gfxModule.cpp b/engines/cruise/gfxModule.cpp
index 47d3f49204..50e6587d90 100644
--- a/engines/cruise/gfxModule.cpp
+++ b/engines/cruise/gfxModule.cpp
@@ -40,6 +40,7 @@ palEntry lpalette[256];
int palDirtyMin = 256;
int palDirtyMax = -1;
+bool isBlack = false;
gfxModuleDataStruct gfxModuleData = {
0, // use Tandy
@@ -237,6 +238,12 @@ void flip() {
g_system->setPalette(paletteRGBA + palDirtyMin*4, palDirtyMin, palDirtyMax - palDirtyMin + 1);
palDirtyMin = 256;
palDirtyMax = -1;
+
+ isBlack = true;
+ for (i = 0; i < 256; ++i) {
+ isBlack = (lpalette[i].R == 0) && (lpalette[i].G == 0) && (lpalette[i].B == 0);
+ if (!isBlack) break;
+ }
}
g_system->copyRectToScreen(globalScreen, 320, 0, 0, 320, 200);