[Scummvm-cvs-logs] SF.net SVN: scummvm:[41196] scummvm/trunk/engines/cruise
dreammaster at users.sourceforge.net
dreammaster at users.sourceforge.net
Fri Jun 5 14:20:43 CEST 2009
Revision: 41196
http://scummvm.svn.sourceforge.net/scummvm/?rev=41196&view=rev
Author: dreammaster
Date: 2009-06-05 12:20:42 +0000 (Fri, 05 Jun 2009)
Log Message:
-----------
Tweaks to the code that pauses for a mouse press when displaying many text messages
Modified Paths:
--------------
scummvm/trunk/engines/cruise/cruise_main.cpp
scummvm/trunk/engines/cruise/gfxModule.cpp
Modified: scummvm/trunk/engines/cruise/cruise_main.cpp
===================================================================
--- scummvm/trunk/engines/cruise/cruise_main.cpp 2009-06-05 10:13:19 UTC (rev 41195)
+++ scummvm/trunk/engines/cruise/cruise_main.cpp 2009-06-05 12:20:42 UTC (rev 41196)
@@ -40,6 +40,8 @@
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 @@
//int32 t_start,t_left;
//uint32 t_end;
//int32 q=0; /* Dummy */
+ int16 mouseX, mouseY;
+ int16 mouseButton;
int enableUser = 0;
@@ -1793,13 +1797,15 @@
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 @@
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 @@
// 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 @@
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;
}
Modified: scummvm/trunk/engines/cruise/gfxModule.cpp
===================================================================
--- scummvm/trunk/engines/cruise/gfxModule.cpp 2009-06-05 10:13:19 UTC (rev 41195)
+++ scummvm/trunk/engines/cruise/gfxModule.cpp 2009-06-05 12:20:42 UTC (rev 41196)
@@ -40,6 +40,7 @@
int palDirtyMin = 256;
int palDirtyMax = -1;
+bool isBlack = false;
gfxModuleDataStruct gfxModuleData = {
0, // use Tandy
@@ -237,6 +238,12 @@
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);
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