[Scummvm-cvs-logs] scummvm master -> 5f4dad1a6dcd86e29f291a8a5d48e8cd085c6bb7

DrMcCoy drmccoy at drmccoy.de
Mon Aug 29 09:51:41 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
5f4dad1a6d GOB: Fix the display length of "You can't use that" texts in Geisha


Commit: 5f4dad1a6dcd86e29f291a8a5d48e8cd085c6bb7
    https://github.com/scummvm/scummvm/commit/5f4dad1a6dcd86e29f291a8a5d48e8cd085c6bb7
Author: Sven Hesse (drmccoy at users.sourceforge.net)
Date: 2011-08-29T00:47:46-07:00

Commit Message:
GOB: Fix the display length of "You can't use that" texts in Geisha

Changed paths:
    engines/gob/hotspots.cpp
    engines/gob/hotspots.h



diff --git a/engines/gob/hotspots.cpp b/engines/gob/hotspots.cpp
index 96b1efb..5e0af84 100644
--- a/engines/gob/hotspots.cpp
+++ b/engines/gob/hotspots.cpp
@@ -202,6 +202,8 @@ Hotspots::Hotspots(GobEngine *vm) : _vm(vm) {
 	_currentKey   = 0;
 	_currentIndex = 0;
 	_currentId    = 0;
+	_currentX     = 0;
+	_currentY     = 0;
 }
 
 Hotspots::~Hotspots() {
@@ -385,6 +387,8 @@ void Hotspots::push(uint8 all, bool force) {
 	backup.key        = _currentKey;
 	backup.id         = _currentId;
 	backup.index      = _currentIndex;
+	backup.x          = _currentX;
+	backup.y          = _currentY;
 
 	backup.hotspots = new Hotspot[size];
 
@@ -415,6 +419,8 @@ void Hotspots::push(uint8 all, bool force) {
 	_currentKey   = 0;
 	_currentId    = 0;
 	_currentIndex = 0;
+	_currentX     = 0;
+	_currentY     = 0;
 
 	_stack.push(backup);
 }
@@ -445,6 +451,8 @@ void Hotspots::pop() {
 	_currentKey   = backup.key;
 	_currentId    = backup.id;
 	_currentIndex = backup.index;
+	_currentX     = backup.x;
+	_currentY     = backup.y;
 
 	delete[] backup.hotspots;
 }
@@ -498,6 +506,9 @@ void Hotspots::enter(uint16 index) {
 	    (spot.getState() == (kStateFilled | kStateType2)))
 		WRITE_VAR(17, -(spot.id & 0x0FFF));
 
+	_currentX = _vm->_global->_inter_mouseX;
+	_currentY = _vm->_global->_inter_mouseY;
+
 	if (spot.funcEnter != 0)
 		call(spot.funcEnter);
 }
@@ -649,9 +660,22 @@ bool Hotspots::checkHotspotChanged() {
 	// Get the current hotspot
 	key = checkMouse(kTypeMove, id, index);
 
-	if (key == _currentKey)
-		// Nothing changed => nothing to do
+	uint16 mouseX = _vm->_global->_inter_mouseX;
+	uint16 mouseY = _vm->_global->_inter_mouseY;
+
+	if (key == _currentKey) {
+		// Still the same hotspot, just update the mouse position
+
+		_currentX = mouseX;
+		_currentY = mouseY;
 		return false;
+	}
+
+	// In Geisha, no move hotspot changes should occur when
+	// we didn't actually move the mouse
+	if (_vm->getGameType() == kGameTypeGeisha)
+		if ((mouseX == _currentX) && (mouseY == _currentY))
+			return false;
 
 	// Leave the old area
 	if (isValid(_currentKey, _currentId,_currentIndex))
@@ -660,6 +684,8 @@ bool Hotspots::checkHotspotChanged() {
 	_currentKey   = key;
 	_currentId    = id;
 	_currentIndex = index;
+	_currentX     = mouseX;
+	_currentY     = mouseY;
 
 	// Enter the new one
 	if (isValid(key, id, index))
diff --git a/engines/gob/hotspots.h b/engines/gob/hotspots.h
index 8d26ad2..b348f9c 100644
--- a/engines/gob/hotspots.h
+++ b/engines/gob/hotspots.h
@@ -158,6 +158,8 @@ private:
 		uint32   key;
 		uint32   id;
 		uint32   index;
+		uint16   x;
+		uint16   y;
 	};
 
 	struct InputDesc {
@@ -178,6 +180,8 @@ private:
 	uint16 _currentKey;
 	uint16 _currentIndex;
 	uint16 _currentId;
+	uint16 _currentX;
+	uint16 _currentY;
 
 	/** Add a hotspot, returning the new index. */
 	uint16 add(const Hotspot &hotspot);






More information about the Scummvm-git-logs mailing list