aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/hotspots.cpp
diff options
context:
space:
mode:
authorSven Hesse2009-07-05 19:56:40 +0000
committerSven Hesse2009-07-05 19:56:40 +0000
commitaeb020602a6f89a5cbc5af66ded393fe8da61212 (patch)
treec99e11a61da4be1deb0469956c0a4ebb73ac9a30 /engines/gob/hotspots.cpp
parenta7ab6c5e92ccf774930846144cc5a272d7ce1542 (diff)
downloadscummvm-rg350-aeb020602a6f89a5cbc5af66ded393fe8da61212.tar.gz
scummvm-rg350-aeb020602a6f89a5cbc5af66ded393fe8da61212.tar.bz2
scummvm-rg350-aeb020602a6f89a5cbc5af66ded393fe8da61212.zip
More state-related encapsulation
svn-id: r42144
Diffstat (limited to 'engines/gob/hotspots.cpp')
-rw-r--r--engines/gob/hotspots.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/engines/gob/hotspots.cpp b/engines/gob/hotspots.cpp
index 9847ae2ae1..987b91ca59 100644
--- a/engines/gob/hotspots.cpp
+++ b/engines/gob/hotspots.cpp
@@ -93,10 +93,14 @@ uint8 Hotspots::Hotspot::getCursor() const {
return (flags & 0xF000) >> 12;
}
-uint8 Hotspots::Hotspot::getState() const {
+uint8 Hotspots::Hotspot::getState(uint16 id) {
return (id & 0xF000) >> 12;
}
+uint8 Hotspots::Hotspot::getState() const {
+ return getState(id);
+}
+
bool Hotspots::Hotspot::isEnd() const {
return (left == 0xFFFF);
}
@@ -202,11 +206,11 @@ void Hotspots::remove(uint16 id) {
}
}
-void Hotspots::removeState(uint16 state) {
+void Hotspots::removeState(uint8 state) {
for (int i = 0; i < kHotspotCount; i++) {
Hotspot &spot = _hotspots[i];
- if ((spot.id & 0xF000) == state)
+ if (spot.getState() == state)
spot.clear();
}
}
@@ -1449,7 +1453,7 @@ void Hotspots::evaluate() {
if (VAR(16) != 0)
break;
- if ((id & 0xF000) == 0x8000)
+ if (Hotspot::getState(id) == 0x8)
WRITE_VAR(16, array[id & 0xFFF]);
else
WRITE_VAR(16, id & 0xFFF);
@@ -1532,7 +1536,7 @@ void Hotspots::evaluate() {
_vm->_inter->storeMouse();
- if ((id & 0xF000) == 0x8000)
+ if (Hotspot::getState(id) == 0x8)
WRITE_VAR(16, array[id & 0xFFF]);
else
WRITE_VAR(16, id & 0xFFF);
@@ -1624,7 +1628,7 @@ void Hotspots::evaluate() {
_vm->_inter->storeMouse();
if (VAR(16) == 0) {
- if ((id & 0xF000) == 0x8000)
+ if (Hotspot::getState(id) == 0x8)
WRITE_VAR(16, array[id & 0xFFF]);
else
WRITE_VAR(16, id & 0xFFF);