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.
This commit is contained in:
David Fioramonti 2017-09-09 08:40:33 -07:00
parent b2dd72adbd
commit d5fb1170d7
3 changed files with 40 additions and 6 deletions

View File

@ -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);
}
}
}

View File

@ -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;

View File

@ -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
*/