[Scummvm-cvs-logs] SF.net SVN: scummvm: [27023] scummvm/trunk/engines/agi/predictive.cpp

knakos at users.sourceforge.net knakos at users.sourceforge.net
Wed May 30 21:51:08 CEST 2007


Revision: 27023
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27023&view=rev
Author:   knakos
Date:     2007-05-30 12:51:08 -0700 (Wed, 30 May 2007)

Log Message:
-----------
fixed predictive dialog messing up state if another dialog was already shown

Modified Paths:
--------------
    scummvm/trunk/engines/agi/predictive.cpp

Modified: scummvm/trunk/engines/agi/predictive.cpp
===================================================================
--- scummvm/trunk/engines/agi/predictive.cpp	2007-05-30 19:49:33 UTC (rev 27022)
+++ scummvm/trunk/engines/agi/predictive.cpp	2007-05-30 19:51:08 UTC (rev 27023)
@@ -114,8 +114,8 @@
 	int bx[17], by[17];
 	String prefix = "";
 	char temp[MAXWORDLEN + 1];
+	AgiBlock tmpwindow;
 	
-	
 	// FIXME: Move this to a more appropriate place.
 	initAsciiToNumTable();
 
@@ -146,6 +146,11 @@
 			return false;
 	}
 
+	// show the predictive dialog.
+	// if another window is already in display, save its state into tmpwindow
+	tmpwindow.active = false;
+	if (_game.window.active)
+		memcpy(&tmpwindow, &(_game.window), sizeof(AgiBlock));
 	drawWindow(50, 40, 269, 159);
 	_gfx->drawRectangle(62, 54, 249, 66, MSG_BOX_TEXT);
 	_gfx->flushBlock(62, 54, 249, 66);
@@ -310,8 +315,18 @@
 	_predictiveResult[prefix.size() + _currentCode.size() + 1] = 0;
 
  getout:
-	closeWindow();
+	// if another window was shown, bring it up again
+	if (!tmpwindow.active)
+		closeWindow();
+	else {
+		_gfx->restoreBlock(_game.window.x1, _game.window.y1,
+				_game.window.x2, _game.window.y2, _game.window.buffer);
 
+		free(_game.window.buffer);
+		memcpy(&(_game.window), &tmpwindow, sizeof(AgiBlock));
+		_gfx->doUpdate();
+	}
+
 	return rc;
 }
 


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