aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2015-03-14 11:41:27 -0400
committerPaul Gilbert2015-03-14 11:41:27 -0400
commitd47197f1fac36082783c6236552fe64415349a94 (patch)
treefed53170d991b8bb672a009386291bfdb030f699 /engines
parentff29535074c630987a99f2ac8bab9600ca2da645 (diff)
downloadscummvm-rg350-d47197f1fac36082783c6236552fe64415349a94.tar.gz
scummvm-rg350-d47197f1fac36082783c6236552fe64415349a94.tar.bz2
scummvm-rg350-d47197f1fac36082783c6236552fe64415349a94.zip
MADS: Fix original bug re-adding disabled hotspots to scene as active
Diffstat (limited to 'engines')
-rw-r--r--engines/mads/screen.cpp4
-rw-r--r--engines/mads/screen.h2
-rw-r--r--engines/mads/user_interface.cpp4
3 files changed, 7 insertions, 3 deletions
diff --git a/engines/mads/screen.cpp b/engines/mads/screen.cpp
index 5076bbb099..c06ff2b7b7 100644
--- a/engines/mads/screen.cpp
+++ b/engines/mads/screen.cpp
@@ -265,7 +265,7 @@ ScreenObjects::ScreenObjects(MADSEngine *vm) : _vm(vm) {
_baseTime = 0;
}
-void ScreenObjects::add(const Common::Rect &bounds, ScreenMode mode, ScrCategory category, int descId) {
+ScreenObject *ScreenObjects::add(const Common::Rect &bounds, ScreenMode mode, ScrCategory category, int descId) {
ScreenObject so;
so._bounds = bounds;
so._category = category;
@@ -274,6 +274,8 @@ void ScreenObjects::add(const Common::Rect &bounds, ScreenMode mode, ScrCategory
so._active = true;
push_back(so);
+
+ return &(*this)[size()];
}
void ScreenObjects::check(bool scanFlag) {
diff --git a/engines/mads/screen.h b/engines/mads/screen.h
index e2462aff18..85c55419ca 100644
--- a/engines/mads/screen.h
+++ b/engines/mads/screen.h
@@ -167,7 +167,7 @@ public:
/**
* Add a new item to the list
*/
- void add(const Common::Rect &bounds, ScreenMode mode, ScrCategory category, int descId);
+ ScreenObject *add(const Common::Rect &bounds, ScreenMode mode, ScrCategory category, int descId);
/**
* Check objects on the screen
diff --git a/engines/mads/user_interface.cpp b/engines/mads/user_interface.cpp
index bcd409889e..0363ae5ef9 100644
--- a/engines/mads/user_interface.cpp
+++ b/engines/mads/user_interface.cpp
@@ -732,7 +732,9 @@ void UserInterface::loadElements() {
_categoryIndexes[CAT_HOTSPOT - 1] = _vm->_game->_screenObjects.size() + 1;
for (int hotspotIdx = scene._hotspots.size() - 1; hotspotIdx >= 0; --hotspotIdx) {
Hotspot &hs = scene._hotspots[hotspotIdx];
- _vm->_game->_screenObjects.add(hs._bounds, SCREENMODE_VGA, CAT_HOTSPOT, hotspotIdx);
+ ScreenObject *so = _vm->_game->_screenObjects.add(hs._bounds, SCREENMODE_VGA,
+ CAT_HOTSPOT, hotspotIdx);
+ so->_active = hs._active;
}
}