[Scummvm-cvs-logs] SF.net SVN: scummvm:[46171] scummvm/trunk/engines/draci

spalek at users.sourceforge.net spalek at users.sourceforge.net
Sat Nov 28 01:57:43 CET 2009


Revision: 46171
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46171&view=rev
Author:   spalek
Date:     2009-11-28 00:57:42 +0000 (Sat, 28 Nov 2009)

Log Message:
-----------
Hopefully fix switching to the map right after switching the location

It seems that the mouse was simply on the below line and triggered the switch
to the map without the user realizing.

Modified Paths:
--------------
    scummvm/trunk/engines/draci/game.cpp
    scummvm/trunk/engines/draci/game.h

Modified: scummvm/trunk/engines/draci/game.cpp
===================================================================
--- scummvm/trunk/engines/draci/game.cpp	2009-11-28 00:38:18 UTC (rev 46170)
+++ scummvm/trunk/engines/draci/game.cpp	2009-11-28 00:57:42 UTC (rev 46171)
@@ -245,7 +245,7 @@
 	rememberRoomNumAsPrevious();
 	scheduleEnteringRoomUsingGate(_info._startRoom, 0);
 	_pushedNewRoom = _pushedNewGate = -1;
-	_mouseChangeTick = -1;
+	_mouseChangeTick = kMouseDoNotSwitch;
 }
 
 void Game::handleOrdinaryLoop(int x, int y) {
@@ -564,15 +564,15 @@
 	}
 
 	if (!wantsChange) {
-		// Disable the timer.
-		_mouseChangeTick = -1;
+		// Turn off the timer, but enable switching.
+		_mouseChangeTick = kMouseEnableSwitching;
 	
 	// Otherwise the mouse signalizes that the mode should be changed.
-	} else if (_mouseChangeTick == -1) {
+	} else if (_mouseChangeTick == kMouseEnableSwitching) {
 		// If the timer is currently disabled, this is the first time
 		// when the mouse left the region.  Start counting.
 		_mouseChangeTick = _vm->_system->getMillis();
-	} else if (_mouseChangeTick == -2) {
+	} else if (_mouseChangeTick == kMouseDoNotSwitch) {
 		// Do nothing.  This exception is good when the status has just
 		// changed.  Even if the mouse starts in the outside region
 		// (e.g., due to flipping the change by a key or due to
@@ -583,10 +583,8 @@
 		if (_loopStatus == kStatusOrdinary) {
 			if (getRoomNum() == getMapRoom()) {
 				scheduleEnteringRoomUsingGate(getPreviousRoomNum(), 0);
-				_mouseChangeTick = -2;
 			} else if (mouseY >= kScreenHeight - 1) {
 				scheduleEnteringRoomUsingGate(getMapRoom(), 0);
-				_mouseChangeTick = -2;
 			} else if (mouseY == 0) {
 				inventoryInit();
 			}
@@ -801,7 +799,7 @@
 	setLoopStatus(kStatusInventory);
 
 	// Don't return from the inventory mode immediately if the mouse is out.
-	_mouseChangeTick = -2;
+	_mouseChangeTick = kMouseDoNotSwitch;
 }
 
 void Game::inventoryDone() {
@@ -822,7 +820,7 @@
 	_itemUnderCursor = NULL;
 
 	// Don't start the inventory mode again if the mouse is on the top.
-	_mouseChangeTick = -2;
+	_mouseChangeTick = kMouseDoNotSwitch;
 }
 
 void Game::inventoryDraw() {
@@ -1303,6 +1301,10 @@
 	setLoopStatus(kStatusOrdinary);
 	setExitLoop(false);
 
+	// Don't immediately switch to the map or inventory even if the mouse
+	// position tell us to.
+	_mouseChangeTick = kMouseDoNotSwitch;
+
 	// Set cursor state
 	// Need to do this after we set the palette since the cursors use it
 	if (_currentRoom._mouseOn) {

Modified: scummvm/trunk/engines/draci/game.h
===================================================================
--- scummvm/trunk/engines/draci/game.h	2009-11-28 00:38:18 UTC (rev 46170)
+++ scummvm/trunk/engines/draci/game.h	2009-11-28 00:57:42 UTC (rev 46171)
@@ -50,6 +50,11 @@
 	kBlackPalette = -1
 };
 
+enum {
+	kMouseEnableSwitching = -1,
+	kMouseDoNotSwitch = -2
+};
+
 // Constants tuned such that with ScummVM's default talkspeed kStandardSpeed, the speed
 // computed by equation (kBaseSpeechDuration + kSpeechTimeUnit * #characters) /
 // talkspeed is equal to the original game.


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