[Scummvm-cvs-logs] SF.net SVN: scummvm:[33686] scummvm/trunk/engines/cine

buddha_ at users.sourceforge.net buddha_ at users.sourceforge.net
Thu Aug 7 21:04:19 CEST 2008


Revision: 33686
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33686&view=rev
Author:   buddha_
Date:     2008-08-07 19:04:19 +0000 (Thu, 07 Aug 2008)

Log Message:
-----------
Fix for popup boxes sometimes blocking animation when they shouldn't in Operation Stealth:
- Made waitForPlayerClick updating more like in the original.
- Moved removeMessages to after the frame drawing in main loop hoping to be more like the original.
- Added an additional test to Operation Stealth's implementation of overlay type 2 drawing.
- Added an additional parameter incrementing and testing to Operation Stealth's removeMessages.
Hopefully this won't cause any regressions in Future Wars!

Modified Paths:
--------------
    scummvm/trunk/engines/cine/gfx.cpp
    scummvm/trunk/engines/cine/main_loop.cpp
    scummvm/trunk/engines/cine/various.cpp

Modified: scummvm/trunk/engines/cine/gfx.cpp
===================================================================
--- scummvm/trunk/engines/cine/gfx.cpp	2008-08-07 19:03:00 UTC (rev 33685)
+++ scummvm/trunk/engines/cine/gfx.cpp	2008-08-07 19:04:19 UTC (rev 33686)
@@ -422,6 +422,7 @@
 
 		_messageLen += messageTable[it->objIdx].size();
 		drawMessage(messageTable[it->objIdx].c_str(), it->x, it->y, it->width, it->color);
+		waitForPlayerClick = 1;
 		break;
 
 	// action failure message
@@ -433,6 +434,7 @@
 		width = width > 300 ? 300 : width;
 
 		drawMessage(failureMessages[idx], (320 - width) / 2, 80, width, 4);
+		waitForPlayerClick = 1;
 		break;
 
 	// bitmap
@@ -1046,6 +1048,19 @@
 		delete[] mask;
 		break;
 
+	// game message
+	case 2:
+		if (it->objIdx >= messageTable.size()) {
+			return;
+		}
+
+		_messageLen += messageTable[it->objIdx].size();
+		drawMessage(messageTable[it->objIdx].c_str(), it->x, it->y, it->width, it->color);		
+		if (it->color >= 0) { // This test isn't in Future Wars's implementation
+			waitForPlayerClick = 1;
+		}
+		break;
+
 	// bitmap
 	case 4:
 		if (objectTable[it->objIdx].frame >= 0) {

Modified: scummvm/trunk/engines/cine/main_loop.cpp
===================================================================
--- scummvm/trunk/engines/cine/main_loop.cpp	2008-08-07 19:03:00 UTC (rev 33685)
+++ scummvm/trunk/engines/cine/main_loop.cpp	2008-08-07 19:04:19 UTC (rev 33686)
@@ -311,6 +311,11 @@
 			renderer->drawFrame();
 		}
 
+		// NOTE: In the original Future Wars and Operation Stealth messages
+		// were removed when running the drawOverlays function which is
+		// currently called from the renderer's drawFrame function.
+		removeMessages();
+
 		if (waitForPlayerClick) {
 			playerAction = false;
 
@@ -340,8 +345,6 @@
 			} while (mouseButton != 0);
 
 			waitForPlayerClick = 0;
-
-			removeMessages();
 		}
 
 		if (checkForPendingDataLoadSwitch) {

Modified: scummvm/trunk/engines/cine/various.cpp
===================================================================
--- scummvm/trunk/engines/cine/various.cpp	2008-08-07 19:03:00 UTC (rev 33685)
+++ scummvm/trunk/engines/cine/various.cpp	2008-08-07 19:04:19 UTC (rev 33686)
@@ -141,7 +141,6 @@
 	tmp.type = 3;
 
 	overlayList.push_back(tmp);
-	waitForPlayerClick = 1;
 }
 
 int16 getRelEntryForObject(uint16 param1, uint16 param2, SelectedObjStruct *pSelectedObject) {
@@ -2002,9 +2001,22 @@
 
 void removeMessages() {
 	Common::List<overlay>::iterator it;
+	bool remove;
 
 	for (it = overlayList.begin(); it != overlayList.end(); ) {
-		if (it->type == 2 || it->type == 3) {
+		if (g_cine->getGameType() == Cine::GType_OS) {
+			// NOTE: These are really removeOverlay calls that have been deferred.
+			// In Operation Stealth's disassembly elements are removed from the
+			// overlay list right in the drawOverlays function (And actually in
+			// some other places too) and that's where incrementing a the overlay's
+			// last parameter by one if it's negative and testing it for positivity
+			// comes from too.
+			remove = it->type == 3 || (it->type == 2 && (it->color >= 0 || ++it->color >= 0));
+		} else { // Future Wars
+			remove = it->type == 2 || it->type == 3;
+		}
+
+		if (remove) {
 			it = overlayList.erase(it);
 		} else {
 			++it;
@@ -2087,7 +2099,6 @@
 	tmp.color = param5;
 
 	overlayList.push_back(tmp);
-	waitForPlayerClick = 1;
 }
 
 Common::List<SeqListElement> seqList;


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