From 3d0f922f7bdb1388f797aa55a8a4f67ea7f7960b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 3 Sep 2016 10:49:03 -0400 Subject: TITANIC: Further conversion of free flags to DisposeAfterUse --- engines/titanic/sound/proximity.cpp | 2 +- engines/titanic/sound/proximity.h | 2 +- engines/titanic/sound/sound.cpp | 5 ++--- engines/titanic/sound/sound_manager.cpp | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) (limited to 'engines/titanic/sound') diff --git a/engines/titanic/sound/proximity.cpp b/engines/titanic/sound/proximity.cpp index 517f22208b..ee1cd3e741 100644 --- a/engines/titanic/sound/proximity.cpp +++ b/engines/titanic/sound/proximity.cpp @@ -31,7 +31,7 @@ CProximity::CProximity() : _channelVolume(100), _balance(0), _azimuth(0.0), _range(0.5), _elevation(0), _posX(0.0), _posY(0.0), _posZ(0.0), _hasVelocity(false), _velocityX(0), _velocityY(0), _velocityZ(0), - _freeSoundFlag(false), _endTalkerFn(nullptr), _talker(nullptr), + _disposeAfterUse(DisposeAfterUse::NO), _endTalkerFn(nullptr), _talker(nullptr), _soundDuration(0), _soundType(Audio::Mixer::kPlainSoundType) { } diff --git a/engines/titanic/sound/proximity.h b/engines/titanic/sound/proximity.h index 06fd2b1d3e..2f0745240d 100644 --- a/engines/titanic/sound/proximity.h +++ b/engines/titanic/sound/proximity.h @@ -54,7 +54,7 @@ public: double _velocityX; double _velocityY; double _velocityZ; - bool _freeSoundFlag; + DisposeAfterUse::Flag _disposeAfterUse; CEndTalkerFn _endTalkerFn; TTtalker *_talker; uint _soundDuration; diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp index 998a0a9827..3288c4f4dd 100644 --- a/engines/titanic/sound/sound.cpp +++ b/engines/titanic/sound/sound.cpp @@ -163,8 +163,7 @@ int CSound::playSound(const CString &name, CProximity &prox) { if (prox._soundType != Audio::Mixer::kPlainSoundType) waveFile->_soundType = prox._soundType; - activateSound(waveFile, prox._freeSoundFlag ? DisposeAfterUse::YES : - DisposeAfterUse::NO); + activateSound(waveFile, prox._disposeAfterUse); return _soundManager.playSound(*waveFile, prox); } @@ -211,7 +210,7 @@ int CSound::playSpeech(CDialogueFile *dialogueFile, int speechId, CProximity &pr return -1; prox._soundDuration = waveFile->getDuration(); - activateSound(waveFile, prox._freeSoundFlag ? DisposeAfterUse::YES : DisposeAfterUse::NO); + activateSound(waveFile, prox._disposeAfterUse); return _soundManager.playSound(*waveFile, prox); } diff --git a/engines/titanic/sound/sound_manager.cpp b/engines/titanic/sound/sound_manager.cpp index fb55e7dad9..1fb0c7341c 100644 --- a/engines/titanic/sound/sound_manager.cpp +++ b/engines/titanic/sound/sound_manager.cpp @@ -419,7 +419,7 @@ int QSoundManager::playWave(CWaveFile *waveFile, int iChannel, uint flags, CProx return slot._handle; } else { _sounds.flushChannel(waveFile, iChannel); - if (prox._freeSoundFlag) + if (prox._disposeAfterUse == DisposeAfterUse::YES) delete waveFile; return 0; } -- cgit v1.2.3