aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2014-04-29 21:53:54 -0400
committerPaul Gilbert2014-04-29 21:53:54 -0400
commitdccc4510e82a7df9c8d3082a7914f6259382df14 (patch)
tree334f4ba79f9c04af638233d73fdf2ead5fb815a3 /engines
parenta770419abcf109ca45b047f2bb361887632db00c (diff)
downloadscummvm-rg350-dccc4510e82a7df9c8d3082a7914f6259382df14.tar.gz
scummvm-rg350-dccc4510e82a7df9c8d3082a7914f6259382df14.tar.bz2
scummvm-rg350-dccc4510e82a7df9c8d3082a7914f6259382df14.zip
MADS: Fix for highlighting and using dynamic hotspots
Diffstat (limited to 'engines')
-rw-r--r--engines/mads/action.cpp4
-rw-r--r--engines/mads/hotspots.cpp6
-rw-r--r--engines/mads/hotspots.h4
-rw-r--r--engines/mads/screen.cpp6
4 files changed, 10 insertions, 10 deletions
diff --git a/engines/mads/action.cpp b/engines/mads/action.cpp
index 03c0c1ed8a..e278ffb740 100644
--- a/engines/mads/action.cpp
+++ b/engines/mads/action.cpp
@@ -168,7 +168,7 @@ void MADSAction::set() {
verbId = scene._hotspots[_hotspotId]._verbId;
} else {
// Get the verb Id from the scene object
- verbId = scene._dynamicHotspots[_hotspotId - scene._hotspots.size()]._vocabId;
+ verbId = scene._dynamicHotspots[_hotspotId - scene._hotspots.size()]._verbId;
}
if (verbId > 0) {
@@ -191,7 +191,7 @@ void MADSAction::set() {
_action._objectNameId = scene._hotspots[_hotspotId]._vocabId;
} else {
// Get name from temporary scene hotspot
- _action._objectNameId = scene._dynamicHotspots[_hotspotId - scene._hotspots.size()]._vocabId;
+ _action._objectNameId = scene._dynamicHotspots[_hotspotId - scene._hotspots.size()]._descId;
}
appendVocab(_action._objectNameId);
}
diff --git a/engines/mads/hotspots.cpp b/engines/mads/hotspots.cpp
index 47d8204437..02617e92c7 100644
--- a/engines/mads/hotspots.cpp
+++ b/engines/mads/hotspots.cpp
@@ -29,7 +29,7 @@ DynamicHotspot::DynamicHotspot() {
_seqIndex = 0;
_facing = FACING_NONE;
_descId = 0;
- _vocabId = 0;
+ _verbId = 0;
_articleNumber = 0;
_cursor = CURSOR_NONE;
}
@@ -47,7 +47,7 @@ DynamicHotspots::DynamicHotspots(MADSEngine *vm) : _vm(vm) {
_count = 0;
}
-int DynamicHotspots::add(int descId, int vocabId, int seqIndex, const Common::Rect &bounds) {
+int DynamicHotspots::add(int descId, int verbId, int seqIndex, const Common::Rect &bounds) {
// Find a free slot
uint idx = 0;
while ((idx < _entries.size()) && _entries[idx]._active)
@@ -61,7 +61,7 @@ int DynamicHotspots::add(int descId, int vocabId, int seqIndex, const Common::Re
_entries[idx]._bounds = bounds;
_entries[idx]._feetPos = Common::Point(-3, 0);
_entries[idx]._facing = FACING_NONE;
- _entries[idx]._vocabId = vocabId;
+ _entries[idx]._verbId = verbId;
_entries[idx]._articleNumber = 6;
_entries[idx]._cursor = CURSOR_NONE;
diff --git a/engines/mads/hotspots.h b/engines/mads/hotspots.h
index a6b991e1dd..9e1cb44a4e 100644
--- a/engines/mads/hotspots.h
+++ b/engines/mads/hotspots.h
@@ -39,7 +39,7 @@ public:
Common::Point _feetPos;
Facing _facing;
int _descId;
- int _vocabId;
+ int _verbId;
int _articleNumber;
CursorType _cursor;
@@ -60,7 +60,7 @@ public:
Common::Array<MADS::DynamicHotspot>::size_type size() const { return _entries.size(); }
DynamicHotspot &operator[](uint idx) { return _entries[idx]; }
- int add(int descId, int vocabId, int seqIndex, const Common::Rect &bounds);
+ int add(int descId, int verbId, int seqIndex, const Common::Rect &bounds);
int setPosition(int index, const Common::Point &pos, Facing facing);
int setCursor(int index, CursorType cursor);
void remove(int index);
diff --git a/engines/mads/screen.cpp b/engines/mads/screen.cpp
index cb914e4f86..ea73d41222 100644
--- a/engines/mads/screen.cpp
+++ b/engines/mads/screen.cpp
@@ -378,7 +378,7 @@ void ScreenObjects::elementHighlighted() {
int index;
int indexEnd = -1;
int var8 = 0;
- //int uiCount;
+ int uiCount;
switch (userInterface._category) {
case CAT_COMMAND:
@@ -445,8 +445,8 @@ void ScreenObjects::elementHighlighted() {
break;
default:
- //uiCount = size() - _uiCount;
- index = scene._hotspots.size();
+ uiCount = size() - _uiCount;
+ index = uiCount + scene._hotspots.size();
indexEnd = index - 1;
varA = 0;
topIndex = 0;