[Scummvm-cvs-logs] scummvm master -> d47197f1fac36082783c6236552fe64415349a94

dreammaster dreammaster at scummvm.org
Sat Mar 14 16:45:38 CET 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
d47197f1fa MADS: Fix original bug re-adding disabled hotspots to scene as active


Commit: d47197f1fac36082783c6236552fe64415349a94
    https://github.com/scummvm/scummvm/commit/d47197f1fac36082783c6236552fe64415349a94
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-03-14T11:41:27-04:00

Commit Message:
MADS: Fix original bug re-adding disabled hotspots to scene as active

Changed paths:
    engines/mads/screen.cpp
    engines/mads/screen.h
    engines/mads/user_interface.cpp



diff --git a/engines/mads/screen.cpp b/engines/mads/screen.cpp
index 5076bbb..c06ff2b 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 e2462af..85c5541 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 bcd4098..0363ae5 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;
 		}
 	}
 






More information about the Scummvm-git-logs mailing list