aboutsummaryrefslogtreecommitdiff
path: root/engines/hopkins
diff options
context:
space:
mode:
authorStrangerke2013-03-21 07:19:10 +0100
committerStrangerke2013-03-21 07:19:10 +0100
commit510eb83aaccd4460887881bd373e403a4d0917cf (patch)
tree844338fbc5cb22469306e9e3fd48cc884e0cdbaa /engines/hopkins
parent8467ea81c87448990da8726da2db76d28d90e131 (diff)
downloadscummvm-rg350-510eb83aaccd4460887881bd373e403a4d0917cf.tar.gz
scummvm-rg350-510eb83aaccd4460887881bd373e403a4d0917cf.tar.bz2
scummvm-rg350-510eb83aaccd4460887881bd373e403a4d0917cf.zip
HOPKINS: Simplify a couple of tests in SoundManager
Diffstat (limited to 'engines/hopkins')
-rw-r--r--engines/hopkins/sound.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/engines/hopkins/sound.cpp b/engines/hopkins/sound.cpp
index b64430fae2..1605b0350e 100644
--- a/engines/hopkins/sound.cpp
+++ b/engines/hopkins/sound.cpp
@@ -732,10 +732,8 @@ void SoundManager::stopVoice(int voiceIndex) {
if (_voice[voiceIndex]._status) {
_voice[voiceIndex]._status = false;
int wavIndex = _voice[voiceIndex]._wavIndex;
- if (_sWav[wavIndex]._active) {
- if (_sWav[wavIndex]._freeSampleFl)
- removeWavSample(wavIndex);
- }
+ if (_sWav[wavIndex]._active && _sWav[wavIndex]._freeSampleFl)
+ removeWavSample(wavIndex);
}
_voice[voiceIndex]._status = false;
}
@@ -802,21 +800,23 @@ void SoundManager::loadWav(const Common::String &file, int wavIndex) {
}
void SoundManager::playWav(int wavIndex) {
- if (!_soundFl && !_soundOffFl) {
- _soundFl = true;
- _currentSoundIndex = wavIndex;
- playWavSample(1, wavIndex);
- }
+ if (_soundFl || _soundOffFl)
+ return;
+
+ _soundFl = true;
+ _currentSoundIndex = wavIndex;
+ playWavSample(1, wavIndex);
}
void SoundManager::delWav(int wavIndex) {
- if (removeWavSample(wavIndex)) {
- if (checkVoiceStatus(1))
- stopVoice(1);
+ if (!removeWavSample(wavIndex))
+ return;
- _currentSoundIndex = 0;
- _soundFl = false;
- }
+ if (checkVoiceStatus(1))
+ stopVoice(1);
+
+ _currentSoundIndex = 0;
+ _soundFl = false;
}
void SoundManager::playWavSample(int voiceIndex, int wavIndex) {