diff options
author | Paul Gilbert | 2017-09-09 18:21:08 -0400 |
---|---|---|
committer | GitHub | 2017-09-09 18:21:08 -0400 |
commit | 04dabb0cd220e030ee3149f11bf9dcf52fdcad0e (patch) | |
tree | 8f998db1a281ca731025cd8449e9c8d3f54a860a | |
parent | 74c401c926f1c38d74c09b290e62de900e741ee6 (diff) | |
parent | 3b579178d447d68f514a809d06ae45ce039ed5b2 (diff) | |
download | scummvm-rg350-04dabb0cd220e030ee3149f11bf9dcf52fdcad0e.tar.gz scummvm-rg350-04dabb0cd220e030ee3149f11bf9dcf52fdcad0e.tar.bz2 scummvm-rg350-04dabb0cd220e030ee3149f11bf9dcf52fdcad0e.zip |
Merge pull request #1017 from dafioram/star-control-changes
TITANIC: Star control changes
-rw-r--r-- | engines/titanic/game/captains_wheel.cpp | 1 | ||||
-rw-r--r-- | engines/titanic/game/nav_helmet.cpp | 45 | ||||
-rw-r--r-- | engines/titanic/game/nav_helmet.h | 4 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control.cpp | 12 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control.h | 5 |
5 files changed, 51 insertions, 16 deletions
diff --git a/engines/titanic/game/captains_wheel.cpp b/engines/titanic/game/captains_wheel.cpp index eafb478d0e..32582ed996 100644 --- a/engines/titanic/game/captains_wheel.cpp +++ b/engines/titanic/game/captains_wheel.cpp @@ -99,6 +99,7 @@ bool CCaptainsWheel::ActMsg(CActMsg *msg) { } } else if (msg->_action == "Go") { if (_stopEnabled) { + _goEnabled = false; incTransitions(); _stopEnabled = false; _actionNum = 1; diff --git a/engines/titanic/game/nav_helmet.cpp b/engines/titanic/game/nav_helmet.cpp index c2496be2a2..f4ea6e4a11 100644 --- a/engines/titanic/game/nav_helmet.cpp +++ b/engines/titanic/game/nav_helmet.cpp @@ -22,6 +22,7 @@ #include "titanic/game/nav_helmet.h" #include "titanic/pet_control/pet_control.h" +#include "titanic/star_control/star_control.h" namespace Titanic { @@ -37,13 +38,13 @@ END_MESSAGE_MAP() void CNavHelmet::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeNumberLine(_flag, indent); + file->writeNumberLine(_helmetOn, indent); CGameObject::save(file, indent); } void CNavHelmet::load(SimpleFile *file) { file->readNumber(); - _flag = file->readNumber(); + _helmetOn = file->readNumber(); CGameObject::load(file); } @@ -51,7 +52,7 @@ bool CNavHelmet::MovieEndMsg(CMovieEndMsg *msg) { CPetControl *pet = getPetControl(); assert(pet); - if (_flag && pet->isAreaUnlocked()) { + if (_helmetOn && pet->isAreaUnlocked()) { setVisible(false); pet->setArea(PET_STARFIELD); @@ -78,8 +79,8 @@ bool CNavHelmet::LeaveViewMsg(CLeaveViewMsg *msg) { bool CNavHelmet::PETHelmetOnOffMsg(CPETHelmetOnOffMsg *msg) { CPetControl *pet = getPetControl(); - if (_flag) { - _flag = false; + if (_helmetOn) { + _helmetOn = false; setVisible(true); starFn(STAR_HIDE); playMovie(61, 120, MOVIE_NOTIFY_OBJECT); @@ -94,7 +95,7 @@ bool CNavHelmet::PETHelmetOnOffMsg(CPETHelmetOnOffMsg *msg) { decTransitions(); } else { incTransitions(); - _flag = true; + _helmetOn = true; setVisible(true); playMovie(0, 60, MOVIE_NOTIFY_OBJECT); playSound("a#48.wav"); @@ -105,20 +106,36 @@ bool CNavHelmet::PETHelmetOnOffMsg(CPETHelmetOnOffMsg *msg) { } bool CNavHelmet::PETPhotoOnOffMsg(CPETPhotoOnOffMsg *msg) { - if (_flag) + if (_helmetOn) starFn(STAR_TOGGLE_MODE); return true; } bool CNavHelmet::PETStarFieldLockMsg(CPETStarFieldLockMsg *msg) { - if (_flag) { - if (msg->_value) { - playSound("a#6.wav"); - starFn(LOCK_STAR); - } else { - playSound("a#5.wav"); - starFn(UNLOCK_STAR); + if (_helmetOn) { + CPetControl *pet = getPetControl(); + CStarControl *starControl = 0; + bool isStarFieldMode=false; + + if (pet) + starControl = pet->getStarControl(); + + if (starControl) + isStarFieldMode = starControl->isStarFieldMode(); + + if (isStarFieldMode) { + // locking and unlocking only in starfield + // It already does this without the conditional + // but now it will also not play the sounds in + // photoview + if (msg->_value) { + playSound("a#6.wav"); + starFn(LOCK_STAR); + } else { + playSound("a#5.wav"); + starFn(UNLOCK_STAR); + } } } diff --git a/engines/titanic/game/nav_helmet.h b/engines/titanic/game/nav_helmet.h index c408d05c97..6e30c4b9c1 100644 --- a/engines/titanic/game/nav_helmet.h +++ b/engines/titanic/game/nav_helmet.h @@ -38,10 +38,10 @@ class CNavHelmet : public CGameObject { bool PETStarFieldLockMsg(CPETStarFieldLockMsg *msg); bool PETSetStarDestinationMsg(CPETSetStarDestinationMsg *msg); private: - bool _flag; + bool _helmetOn; public: CLASSDEF; - CNavHelmet() : CGameObject(), _flag(false) {} + CNavHelmet() : CGameObject(), _helmetOn(false) {} /** * Save the data for the class to file diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp index cc414305eb..8464262b31 100644 --- a/engines/titanic/star_control/star_control.cpp +++ b/engines/titanic/star_control/star_control.cpp @@ -145,6 +145,18 @@ void CStarControl::newFrame() { } } +bool CStarControl::isStarFieldMode() { + if (!_petControl) + _petControl = getPetControl(); + + if (_petControl) { + + if (_starField.getMode() == MODE_STARFIELD) + return true; + } + return false; +} + void CStarControl::doAction(StarControlAction action) { if (!_enabled) return; diff --git a/engines/titanic/star_control/star_control.h b/engines/titanic/star_control/star_control.h index e4072d7d62..7efd3869c1 100644 --- a/engines/titanic/star_control/star_control.h +++ b/engines/titanic/star_control/star_control.h @@ -70,6 +70,11 @@ public: virtual void draw(CScreenManager *screenManager); /** + * _starField is currently showing the starfield + */ + bool isStarFieldMode(); + + /** * Does an action in the star control */ void doAction(StarControlAction action); |