TITANIC: Fix sound effects on the Promenade Deck

This commit is contained in:
Paul Gilbert 2017-08-01 21:25:52 -04:00
parent f4f15667a5
commit 8864cfc0fa
4 changed files with 14 additions and 12 deletions

View File

@ -138,9 +138,10 @@ bool CFanNoises::StatusChangeMsg(CStatusChangeMsg *msg) {
}
switch (oldState) {
case 1:
case 0:
case 2:
_soundHandle = playSound("b#60.wav", _soundPercent, _soundBalance);
_soundHandle = playSound("b#60.wav", _soundPercent, _soundBalance, true);
_startFlag = true;
break;
default:
break;
@ -157,6 +158,7 @@ bool CFanNoises::StatusChangeMsg(CStatusChangeMsg *msg) {
if (oldState == 1) {
_soundHandle = playSound("b#58.wav", _soundPercent, _soundBalance, true);
_startFlag = true;
}
break;

View File

@ -33,13 +33,13 @@ BEGIN_MESSAGE_MAP(CAutoSoundPlayer, CGameObject)
END_MESSAGE_MAP()
CAutoSoundPlayer::CAutoSoundPlayer() : CGameObject(),
_fieldBC(0), _volume(70), _balance(0), _repeated(false), _soundHandle(-1),
_stopSeconds(0), _startSeconds(-1), _active(false), _fieldE8(0) {
_unused(0), _volume(70), _balance(0), _repeated(false), _soundHandle(-1),
_stopSeconds(0), _startSeconds(-1), _active(false), _isVectorSound(false) {
}
void CAutoSoundPlayer::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_fieldBC, indent);
file->writeNumberLine(_unused, indent);
file->writeQuotedLine(_filename, indent);
file->writeNumberLine(_volume, indent);
file->writeNumberLine(_balance, indent);
@ -48,14 +48,14 @@ void CAutoSoundPlayer::save(SimpleFile *file, int indent) {
file->writeNumberLine(_stopSeconds, indent);
file->writeNumberLine(_startSeconds, indent);
file->writeNumberLine(_active, indent);
file->writeNumberLine(_fieldE8, indent);
file->writeNumberLine(_isVectorSound, indent);
CGameObject::save(file, indent);
}
void CAutoSoundPlayer::load(SimpleFile *file) {
file->readNumber();
_fieldBC = file->readNumber();
_unused = file->readNumber();
_filename = file->readString();
_volume = file->readNumber();
_balance = file->readNumber();
@ -64,7 +64,7 @@ void CAutoSoundPlayer::load(SimpleFile *file) {
_stopSeconds = file->readNumber();
_startSeconds = file->readNumber();
_active = file->readNumber();
_fieldE8 = file->readNumber();
_isVectorSound = file->readNumber();
CGameObject::load(file);
}
@ -74,7 +74,7 @@ bool CAutoSoundPlayer::TurnOn(CTurnOn *msg) {
CProximity prox;
prox._balance = _balance;
prox._repeated = _repeated;
if (_fieldE8)
if (_isVectorSound)
prox._positioningMode = POSMODE_VECTOR;
prox._channelVolume = (_startSeconds == -1) ? _volume : 0;

View File

@ -35,7 +35,7 @@ class CAutoSoundPlayer : public CGameObject {
bool SetVolumeMsg(CSetVolumeMsg *msg);
bool LoadSuccessMsg(CLoadSuccessMsg *msg);
public:
int _fieldBC;
int _unused;
CString _filename;
int _volume;
int _balance;
@ -44,7 +44,7 @@ public:
int _stopSeconds;
int _startSeconds;
bool _active;
int _fieldE8;
bool _isVectorSound;
public:
CLASSDEF;
CAutoSoundPlayer();

View File

@ -24,7 +24,7 @@
namespace Titanic {
BEGIN_MESSAGE_MAP(CBirdSong, CAutoSoundPlayer)
BEGIN_MESSAGE_MAP(CBirdSong, CRoomAutoSoundPlayer)
ON_MESSAGE(TurnOn)
ON_MESSAGE(SignalObject)
END_MESSAGE_MAP()