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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Thu Apr 24 19:32:24 CEST 2008


Revision: 31696
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31696&view=rev
Author:   thebluegr
Date:     2008-04-24 10:32:24 -0700 (Thu, 24 Apr 2008)

Log Message:
-----------
Fixed regression: CINE games crashed when a message box appeared (patch by next_ghost)

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

Modified: scummvm/trunk/engines/cine/various.cpp
===================================================================
--- scummvm/trunk/engines/cine/various.cpp	2008-04-24 15:49:41 UTC (rev 31695)
+++ scummvm/trunk/engines/cine/various.cpp	2008-04-24 17:32:24 UTC (rev 31696)
@@ -1748,14 +1748,15 @@
 
 void drawDialogueMessage(byte msgIdx, int16 x, int16 y, int16 width, int16 color) {
 	if (msgIdx >= messageTable.size()) {
-		removeOverlay(msgIdx, 2);
+//		removeOverlay(msgIdx, 2);
 		return;
 	}
 
 	_messageLen += messageTable[msgIdx].size();
 	drawMessage(messageTable[msgIdx].c_str(), x, y, width, color);
 
-	removeOverlay(msgIdx, 2);
+	// this invalidates the iterator in drawOverlays()
+//	removeOverlay(msgIdx, 2);
 }
 
 void drawFailureMessage(byte cmd) {
@@ -1777,7 +1778,8 @@
 
 	drawMessage(messagePtr, x, y, width, color);
 
-	removeOverlay(cmd, 3);
+	// this invalidates the iterator in drawOverlays()
+//	removeOverlay(cmd, 3);
 }
 
 void drawOverlays(void) {
@@ -1901,6 +1903,14 @@
 			break;
 		}
 	}
+
+	for (it = overlayList.begin(); it != overlayList.end(); ) {
+		if (it->type == 2 || it->type == 3) {
+			it = overlayList.erase(it);
+		} else {
+			++it;
+		}
+	}
 }
 
 uint16 processKeyboard(uint16 param) {


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