diff options
-rw-r--r-- | engines/gob/hotspots.cpp | 10 | ||||
-rw-r--r-- | engines/gob/hotspots.h | 3 |
2 files changed, 13 insertions, 0 deletions
diff --git a/engines/gob/hotspots.cpp b/engines/gob/hotspots.cpp index d21eb906ee..4da2262eb1 100644 --- a/engines/gob/hotspots.cpp +++ b/engines/gob/hotspots.cpp @@ -1564,6 +1564,16 @@ int16 Hotspots::findCursor(uint16 x, uint16 y) const { return cursor; } +bool Hotspots::searchHotspot(int16 shortId) { + for (int i = 0; i < kHotspotCount; i++) { + if (_hotspots[i].isDisabled()) + return false; + if ((_hotspots[i].id == 0xD000 + shortId) || (_hotspots[i].id == 0xB000 + shortId) || (_hotspots[i].id == 0x4000 + shortId)) + return true; + } + return false; +} + uint16 Hotspots::inputToHotspot(uint16 input) const { uint16 inputIndex = 0; for (int i = 0; i < kHotspotCount; i++) { diff --git a/engines/gob/hotspots.h b/engines/gob/hotspots.h index a389987c27..25e77d526b 100644 --- a/engines/gob/hotspots.h +++ b/engines/gob/hotspots.h @@ -101,6 +101,9 @@ public: /** Return the cursor found in the hotspot to the coordinates. */ int16 findCursor(uint16 x, uint16 y) const; + /** Check the existance of a hotspot based on its short Id */ + bool searchHotspot (int16 shortId); + private: struct Hotspot { uint16 id; |