[Scummvm-git-logs] scummvm master -> 89457af33e7e1682e6e8a9b9ba758ab2677ec936

dreammaster dreammaster at scummvm.org
Sun Aug 6 21:27:51 CEST 2017


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:
89457af33e TITANIC: Don't allow movement link to be used in Starfield Puzlze


Commit: 89457af33e7e1682e6e8a9b9ba758ab2677ec936
    https://github.com/scummvm/scummvm/commit/89457af33e7e1682e6e8a9b9ba758ab2677ec936
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-08-06T15:25:28-04:00

Commit Message:
TITANIC: Don't allow movement link to be used in Starfield Puzlze

The scene has an unused right turn link that wasn't used, and is
covered by the starview. Since movement now uses simulated mouse
clicks, the worst result of clicking right arrow is simply that
a star may be accidentally selected. But for cleanliness, it was
best to fix it. It also allowed the creation of code that other
objects in the view can use to override default movement logic,
just in case it's needed.

Changed paths:
    engines/titanic/core/view_item.cpp
    engines/titanic/star_control/star_control.cpp
    engines/titanic/star_control/star_control.h


diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index 19e1a11..401553d 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -341,7 +341,15 @@ CString CViewItem::getNodeViewName() const {
 bool CViewItem::MovementMsg(CMovementMsg *msg) {
 	Point pt;
 
-	// Iterate through the links to find an appropriate link
+	// First allow any child objects to handle it
+	for (CTreeItem *treeItem = getFirstChild(); treeItem;
+		treeItem = treeItem->scan(this)) {
+		if (msg->execute(treeItem, nullptr, 0))
+			return true;
+	}
+
+	// Iterate through the view's contents to find a link or item
+	// with the appropriate movement action
 	for (CTreeItem *treeItem = getFirstChild(); treeItem;
 			treeItem = treeItem->scan(this)) {
 		CLinkItem *link = dynamic_cast<CLinkItem *>(treeItem);
diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp
index 42f81f5..ee29629 100644
--- a/engines/titanic/star_control/star_control.cpp
+++ b/engines/titanic/star_control/star_control.cpp
@@ -39,6 +39,7 @@ BEGIN_MESSAGE_MAP(CStarControl, CGameObject)
 	ON_MESSAGE(MouseButtonDownMsg)
 	ON_MESSAGE(KeyCharMsg)
 	ON_MESSAGE(FrameMsg)
+	ON_MESSAGE(MovementMsg)
 END_MESSAGE_MAP()
 
 CStarControl::CStarControl() : _enabled(false), _petControl(nullptr),
@@ -276,4 +277,11 @@ void CStarControl::starDestinationSet() {
 	_view.starDestinationSet();
 }
 
+bool CStarControl::MovementMsg(CMovementMsg *msg) {
+	// The star control view has an unused turn right link hidden
+	// under the star view. For cleanliness, explicitly consume any
+	// movements in the star view so the link is never used
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control.h b/engines/titanic/star_control/star_control.h
index 776f25a..8013eed 100644
--- a/engines/titanic/star_control/star_control.h
+++ b/engines/titanic/star_control/star_control.h
@@ -36,6 +36,7 @@ class CStarControl : public CGameObject {
 	bool MouseMoveMsg(CMouseMoveMsg *msg);
 	bool KeyCharMsg(CKeyCharMsg *msg);
 	bool FrameMsg(CFrameMsg *msg);
+	bool MovementMsg(CMovementMsg *msg);
 private:
 	bool _enabled;
 	CStarField _starField;





More information about the Scummvm-git-logs mailing list