aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2017-03-29 22:25:33 -0400
committerPaul Gilbert2017-03-29 22:25:33 -0400
commit09da42129374f215301d6295cd6b092d1b3e6fee (patch)
treea0203cfc3bafce605136d0978d9366271bd865dd
parent119fd5fd34654c4c1af86f6952b6b2e5e94ee927 (diff)
downloadscummvm-rg350-09da42129374f215301d6295cd6b092d1b3e6fee.tar.gz
scummvm-rg350-09da42129374f215301d6295cd6b092d1b3e6fee.tar.bz2
scummvm-rg350-09da42129374f215301d6295cd6b092d1b3e6fee.zip
TITANIC: Further code for new skip nav button to work correctly
-rw-r--r--engines/titanic/pet_control/pet_remote_glyphs.cpp5
-rw-r--r--engines/titanic/star_control/star_control.cpp5
-rw-r--r--engines/titanic/star_control/star_control.h5
3 files changed, 15 insertions, 0 deletions
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.cpp b/engines/titanic/pet_control/pet_remote_glyphs.cpp
index e9b2094dc8..b56c2f6854 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_remote_glyphs.cpp
@@ -24,6 +24,7 @@
#include "titanic/pet_control/pet_remote.h"
#include "titanic/pet_control/pet_control.h"
#include "titanic/messages/pet_messages.h"
+#include "titanic/star_control/star_control.h"
#include "titanic/support/strings.h"
#include "titanic/titanic.h"
@@ -643,6 +644,10 @@ bool CSkipNavigationGlyph::MouseButtonDownMsg(const Point &pt) {
bool CSkipNavigationGlyph::MouseButtonUpMsg(const Point &pt) {
if (_button && _button->MouseButtonUpMsg(pt)) {
+ CPetRemote *remote = static_cast<CPetRemote *>(_owner->getOwner());
+ CStarControl *starControl = remote->getPetControl()->getStarControl();
+ starControl->forceSolved();
+
CActMsg actMsg("SetDestin");
actMsg.execute("CaptainsWheel");
return true;
diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp
index dbe8b01aa0..881de58f70 100644
--- a/engines/titanic/star_control/star_control.cpp
+++ b/engines/titanic/star_control/star_control.cpp
@@ -260,6 +260,11 @@ bool CStarControl::isSolved() const {
return _starField.isSolved();
}
+void CStarControl::forceSolved() {
+ while (!_starField.isSolved())
+ _starField.fn7();
+}
+
bool CStarControl::canSetStarDestination() const {
return _view.canSetStarDestination();
}
diff --git a/engines/titanic/star_control/star_control.h b/engines/titanic/star_control/star_control.h
index 11e6053702..2c314a67a8 100644
--- a/engines/titanic/star_control/star_control.h
+++ b/engines/titanic/star_control/star_control.h
@@ -78,6 +78,11 @@ public:
bool isSolved() const;
/**
+ * Forces the starfield to be solved
+ */
+ void forceSolved();
+
+ /**
* Returns true if a star destination can be set
*/
bool canSetStarDestination() const;