diff options
author | Arnaud Boutonné | 2010-02-03 22:14:06 +0000 |
---|---|---|
committer | Arnaud Boutonné | 2010-02-03 22:14:06 +0000 |
commit | f5764b115200bd69cde6732f21f1de16057e0401 (patch) | |
tree | 6618d052d56f73059aa2909c6908007a9e34701f /engines/gob | |
parent | b2876ca9d3b322b4d9c38d924005dde8630a01db (diff) | |
download | scummvm-rg350-f5764b115200bd69cde6732f21f1de16057e0401.tar.gz scummvm-rg350-f5764b115200bd69cde6732f21f1de16057e0401.tar.bz2 scummvm-rg350-f5764b115200bd69cde6732f21f1de16057e0401.zip |
Fascination - based on the theoritical values of flag, use getWindow instead of the code I added. Suppress shr 8 in getWindow and switched from int8 to uint16, in order to match the executable.
svn-id: r47868
Diffstat (limited to 'engines/gob')
-rw-r--r-- | engines/gob/hotspots.cpp | 26 | ||||
-rw-r--r-- | engines/gob/hotspots.h | 2 |
2 files changed, 15 insertions, 13 deletions
diff --git a/engines/gob/hotspots.cpp b/engines/gob/hotspots.cpp index 941177ed08..5159144557 100644 --- a/engines/gob/hotspots.cpp +++ b/engines/gob/hotspots.cpp @@ -85,8 +85,8 @@ MouseButtons Hotspots::Hotspot::getButton() const { return kMouseButtonsNone; } -uint8 Hotspots::Hotspot::getWindow() const { - return (flags & 0x0F00) >> 8; +uint16 Hotspots::Hotspot::getWindow() const { + return (flags & 0x0F00); } uint8 Hotspots::Hotspot::getCursor() const { @@ -576,16 +576,16 @@ uint16 Hotspots::checkMouse(Type type, uint16 &id, uint16 &index) const { continue; //Strangerke, for Fascination - if ((spot.flags & 0xFF00) != winId) - continue; +// if ((spot.flags & 0xFF00) != winId) +// continue; if (spot.getType() > kTypeMove) // Only consider click and move hotspots continue; -// if (spot.getWindow() != 0) - // Only check the main window -// continue; + if (spot.getWindow() != winId) + // Only check the current window + continue; if (!spot.isIn(_vm->_global->_inter_mouseX - dx, _vm->_global->_inter_mouseY - dy)) // If we're not in it, ignore it @@ -610,13 +610,13 @@ uint16 Hotspots::checkMouse(Type type, uint16 &id, uint16 &index) const { continue; //Strangerke, for Fascination - if ((spot.flags & 0xFF00) != winId) - continue; - -// if (spot.getWindow() != 0) - // Only check the main window +// if ((spot.flags & 0xFF00) != winId) // continue; + if (spot.getWindow() != winId) + // Only check the active window + continue; + if (spot.getType() < kTypeMove) // Only consider hotspots that can be clicked continue; @@ -1665,6 +1665,8 @@ int16 Hotspots::findCursor(uint16 x, uint16 y) const { cursor = 0; for (int i = 0; (i < kHotspotCount) && !_hotspots[i].isEnd(); i++) { const Hotspot &spot = _hotspots[i]; + // this check is /really/ Fascination specific. + // It's illogical, so if it's to be reused in Adi games... Be careful! if ((spot.flags & 0xFF00) == curType) if (spot.isIn(x - deltax, y - deltay)) { if (spot.getType() < kTypeInput1NoLeave) diff --git a/engines/gob/hotspots.h b/engines/gob/hotspots.h index 66d5b14695..a7cbf9d6e8 100644 --- a/engines/gob/hotspots.h +++ b/engines/gob/hotspots.h @@ -128,7 +128,7 @@ private: Type getType () const; MouseButtons getButton() const; - uint8 getWindow() const; + uint16 getWindow() const; uint8 getCursor() const; uint8 getState () const; |