From f5764b115200bd69cde6732f21f1de16057e0401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Boutonn=C3=A9?= Date: Wed, 3 Feb 2010 22:14:06 +0000 Subject: [PATCH] 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 --- engines/gob/hotspots.cpp | 26 ++++++++++++++------------ 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 941177ed088..5159144557c 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 66d5b14695a..a7cbf9d6e8a 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;