aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2016-09-03 10:49:03 -0400
committerPaul Gilbert2016-09-03 10:49:03 -0400
commit3d0f922f7bdb1388f797aa55a8a4f67ea7f7960b (patch)
tree36b1832c08b09c5bc778213cd2ec8be7a9d9cb24
parentc224d35a432fff7e1d0a6bf5368f7f2e81a45e27 (diff)
downloadscummvm-rg350-3d0f922f7bdb1388f797aa55a8a4f67ea7f7960b.tar.gz
scummvm-rg350-3d0f922f7bdb1388f797aa55a8a4f67ea7f7960b.tar.bz2
scummvm-rg350-3d0f922f7bdb1388f797aa55a8a4f67ea7f7960b.zip
TITANIC: Further conversion of free flags to DisposeAfterUse
-rw-r--r--engines/titanic/sound/proximity.cpp2
-rw-r--r--engines/titanic/sound/proximity.h2
-rw-r--r--engines/titanic/sound/sound.cpp5
-rw-r--r--engines/titanic/sound/sound_manager.cpp2
4 files changed, 5 insertions, 6 deletions
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;
}