aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorDavid Fioramonti2017-09-09 08:40:33 -0700
committerDavid Fioramonti2017-09-09 14:24:26 -0700
commitd5fb1170d7d3e9cbe2029d494f6a438745f6490c (patch)
tree7048d657dc5eecdf7796d07a04c7a5ce7278daac /engines
parentb2dd72adbdf7fad21438f4860ad8b420b5a82812 (diff)
downloadscummvm-rg350-d5fb1170d7d3e9cbe2029d494f6a438745f6490c.tar.gz
scummvm-rg350-d5fb1170d7d3e9cbe2029d494f6a438745f6490c.tar.bz2
scummvm-rg350-d5fb1170d7d3e9cbe2029d494f6a438745f6490c.zip
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.
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/game/nav_helmet.cpp29
-rw-r--r--engines/titanic/star_control/star_control.cpp12
-rw-r--r--engines/titanic/star_control/star_control.h5
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
@@ -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);