aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/hotspots.cpp
diff options
context:
space:
mode:
authorSven Hesse2011-08-29 09:47:46 +0200
committerSven Hesse2011-08-29 09:47:46 +0200
commit5f4dad1a6dcd86e29f291a8a5d48e8cd085c6bb7 (patch)
tree9be19ed0345631b841b329801722d00664f6b724 /engines/gob/hotspots.cpp
parentdfe9fc05aabfb6097ef580e5fba42fda8e7cb098 (diff)
downloadscummvm-rg350-5f4dad1a6dcd86e29f291a8a5d48e8cd085c6bb7.tar.gz
scummvm-rg350-5f4dad1a6dcd86e29f291a8a5d48e8cd085c6bb7.tar.bz2
scummvm-rg350-5f4dad1a6dcd86e29f291a8a5d48e8cd085c6bb7.zip
GOB: Fix the display length of "You can't use that" texts in Geisha
Diffstat (limited to 'engines/gob/hotspots.cpp')
-rw-r--r--engines/gob/hotspots.cpp30
1 files changed, 28 insertions, 2 deletions
diff --git a/engines/gob/hotspots.cpp b/engines/gob/hotspots.cpp
index 96b1efbcf1..5e0af847de 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))