From b2dd72adbdf7fad21438f4860ad8b420b5a82812 Mon Sep 17 00:00:00 2001 From: David Fioramonti Date: Sat, 9 Sep 2017 06:54:16 -0700 Subject: TITANIC: Improved naming for Helmet On/Off flag --- engines/titanic/game/nav_helmet.cpp | 16 ++++++++-------- engines/titanic/game/nav_helmet.h | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/engines/titanic/game/nav_helmet.cpp b/engines/titanic/game/nav_helmet.cpp index c2496be2a2..498f52b0cb 100644 --- a/engines/titanic/game/nav_helmet.cpp +++ b/engines/titanic/game/nav_helmet.cpp @@ -37,13 +37,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 +51,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 +78,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 +94,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,14 +105,14 @@ 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 (_helmetOn) { if (msg->_value) { playSound("a#6.wav"); starFn(LOCK_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 -- cgit v1.2.3 From d5fb1170d7d3e9cbe2029d494f6a438745f6490c Mon Sep 17 00:00:00 2001 From: David Fioramonti Date: Sat, 9 Sep 2017 08:40:33 -0700 Subject: TITANIC: Prevent locking/unlocking sounds in photoview In scummvm and the original engine if you try to unlock/lock stars in photoview/skyview then the stars will not unlock/lock, but the sounds associated with unlocking and locking were playing. Giving a false impression that the locking/unlocking was happening. The sounds no longer play when in photoview. --- engines/titanic/game/nav_helmet.cpp | 29 +++++++++++++++++++++------ engines/titanic/star_control/star_control.cpp | 12 +++++++++++ engines/titanic/star_control/star_control.h | 5 +++++ 3 files changed, 40 insertions(+), 6 deletions(-) diff --git a/engines/titanic/game/nav_helmet.cpp b/engines/titanic/game/nav_helmet.cpp index 498f52b0cb..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 { @@ -113,12 +114,28 @@ bool CNavHelmet::PETPhotoOnOffMsg(CPETPhotoOnOffMsg *msg) { bool CNavHelmet::PETStarFieldLockMsg(CPETStarFieldLockMsg *msg) { if (_helmetOn) { - if (msg->_value) { - playSound("a#6.wav"); - starFn(LOCK_STAR); - } else { - playSound("a#5.wav"); - starFn(UNLOCK_STAR); + 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/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 @@ -69,6 +69,11 @@ public: */ virtual void draw(CScreenManager *screenManager); + /** + * _starField is currently showing the starfield + */ + bool isStarFieldMode(); + /** * Does an action in the star control */ -- cgit v1.2.3 From 3b579178d447d68f514a809d06ae45ce039ed5b2 Mon Sep 17 00:00:00 2001 From: David Fioramonti Date: Sat, 9 Sep 2017 14:06:15 -0700 Subject: TITANIC: Hitting go on captain wheel resets it In the original once you have hit the go button on the steering wheel it won't let you use it again until you have solved the puzzle so that is how ScummVM does it now. --- engines/titanic/game/captains_wheel.cpp | 1 + 1 file changed, 1 insertion(+) 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; -- cgit v1.2.3