aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorArnaud Boutonné2009-08-27 10:37:48 +0000
committerArnaud Boutonné2009-08-27 10:37:48 +0000
commit9078ee4e7f22c4318a09a17efc5d756ccdf1bf0f (patch)
tree40c34c64390e6b38122cc34b07d3fccfb72860ea /engines
parent6044cea5a04e2e3c8b33deea6bbbb753a483d6b4 (diff)
downloadscummvm-rg350-9078ee4e7f22c4318a09a17efc5d756ccdf1bf0f.tar.gz
scummvm-rg350-9078ee4e7f22c4318a09a17efc5d756ccdf1bf0f.tar.bz2
scummvm-rg350-9078ee4e7f22c4318a09a17efc5d756ccdf1bf0f.zip
Playtoons/Adi2 - Add rudimentary Hotspots search function based on shortId. The long Id checked is ShortId plus 0xD000, 0xB000 or 0x4000.
svn-id: r43766
Diffstat (limited to 'engines')
-rw-r--r--engines/gob/hotspots.cpp10
-rw-r--r--engines/gob/hotspots.h3
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;