aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/sound_lol.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2009-05-24 01:29:09 +0000
committerJohannes Schickel2009-05-24 01:29:09 +0000
commit344caa88fcf8ce352e7bee6b2c6d4a8df2df548e (patch)
tree34060263b7e3c21cfab3df09ce811fe7d094d34e /engines/kyra/sound_lol.cpp
parentc2812140274d1c37e57f732f0a30e8a39d30e2ca (diff)
downloadscummvm-rg350-344caa88fcf8ce352e7bee6b2c6d4a8df2df548e.tar.gz
scummvm-rg350-344caa88fcf8ce352e7bee6b2c6d4a8df2df548e.tar.bz2
scummvm-rg350-344caa88fcf8ce352e7bee6b2c6d4a8df2df548e.zip
Make various Sound functionality SoundHandle instead of filename based.
- This fixes multiple sounds being played at once in Lands of Lore svn-id: r40848
Diffstat (limited to 'engines/kyra/sound_lol.cpp')
-rw-r--r--engines/kyra/sound_lol.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/engines/kyra/sound_lol.cpp b/engines/kyra/sound_lol.cpp
index 1f5b155b94..7afba2ae10 100644
--- a/engines/kyra/sound_lol.cpp
+++ b/engines/kyra/sound_lol.cpp
@@ -29,8 +29,6 @@
namespace Kyra {
-#define LOL_VOICE_HANDLE "LoL_VOICE"
-
bool LoLEngine::snd_playCharacterSpeech(int id, int8 speaker, int) {
if (!_speechFlag)
return false;
@@ -88,22 +86,22 @@ bool LoLEngine::snd_playCharacterSpeech(int id, int8 speaker, int) {
if (newSpeechList.empty())
return false;
- while (_sound->voiceIsPlaying(LOL_VOICE_HANDLE))
+ while (_sound->voiceIsPlaying(&_speechHandle))
delay(_tickLength, true, false);
while (_sound->allVoiceChannelsPlaying())
delay(_tickLength, false, true);
- _activeVoiceFileTotalTime = 0;
for (Common::List<Audio::AudioStream *>::iterator i = _speechList.begin(); i != _speechList.end(); ++i)
delete *i;
_speechList.clear();
_speechList = newSpeechList;
+ _activeVoiceFileTotalTime = 0;
for (Common::List<Audio::AudioStream *>::const_iterator i = _speechList.begin(); i != _speechList.end(); ++i)
_activeVoiceFileTotalTime += (*i)->getTotalPlayTime();
- _sound->playVoiceStream(*_speechList.begin(), LOL_VOICE_HANDLE);
+ _sound->playVoiceStream(*_speechList.begin(), &_speechHandle);
_speechList.pop_front();
if (!_activeVoiceFileTotalTime)
@@ -115,11 +113,11 @@ bool LoLEngine::snd_playCharacterSpeech(int id, int8 speaker, int) {
}
int LoLEngine::snd_updateCharacterSpeech() {
- if (_sound->voiceIsPlaying(LOL_VOICE_HANDLE))
+ if (_sound->voiceIsPlaying(&_speechHandle))
return 2;
if (_speechList.begin() != _speechList.end()) {
- _sound->playVoiceStream(*_speechList.begin(), LOL_VOICE_HANDLE);
+ _sound->playVoiceStream(*_speechList.begin(), &_speechHandle);
_speechList.pop_front();
return 2;
@@ -137,11 +135,11 @@ int LoLEngine::snd_updateCharacterSpeech() {
}
void LoLEngine::snd_stopSpeech(bool setFlag) {
- if (!_sound->voiceIsPlaying(LOL_VOICE_HANDLE))
+ if (!_sound->voiceIsPlaying(&_speechHandle))
return;
//_dlgTimer = 0;
- _sound->voiceStop(LOL_VOICE_HANDLE);
+ _sound->voiceStop(&_speechHandle);
_activeVoiceFileTotalTime = 0;
_nextSpeechId = _nextSpeaker = -1;