aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/sound.cpp
diff options
context:
space:
mode:
authorFlorian Kagerer2008-02-17 02:06:04 +0000
committerFlorian Kagerer2008-02-17 02:06:04 +0000
commit753536fa61119a20a5e0d0e9b00790593cd5190e (patch)
tree336fe694314c829ff8c5da1c515c27b506eb5b92 /engines/kyra/sound.cpp
parent9146cf360301f5bd1822a111c9e49b8e8f497211 (diff)
downloadscummvm-rg350-753536fa61119a20a5e0d0e9b00790593cd5190e.tar.gz
scummvm-rg350-753536fa61119a20a5e0d0e9b00790593cd5190e.tar.bz2
scummvm-rg350-753536fa61119a20a5e0d0e9b00790593cd5190e.zip
committing patch 1891492 : dialogue (dlg/tim) support for HoF
- talking to NPCs is now possible. - Zanthia's talks when entering a new scene for the first time now work - using items on Zanthia is now possible. svn-id: r30886
Diffstat (limited to 'engines/kyra/sound.cpp')
-rw-r--r--engines/kyra/sound.cpp30
1 files changed, 22 insertions, 8 deletions
diff --git a/engines/kyra/sound.cpp b/engines/kyra/sound.cpp
index a93a9ed66a..692db54af5 100644
--- a/engines/kyra/sound.cpp
+++ b/engines/kyra/sound.cpp
@@ -39,7 +39,7 @@
namespace Kyra {
Sound::Sound(KyraEngine *vm, Audio::Mixer *mixer)
- : _vm(vm), _mixer(mixer), _currentVocFile(0), _vocHandle(),
+ : _vm(vm), _mixer(mixer), _currentVocFile(0), _vocHandles(),
_musicEnabled(1), _sfxEnabled(true), _soundDataList(0) {
}
@@ -52,6 +52,14 @@ void Sound::voicePlay(const char *file) {
bool found = false;
char filenamebuffer[25];
+ int h = 0;
+ if (_currentVocFile) {
+ while (_mixer->isSoundHandleActive(_vocHandles[h]))
+ h++;
+ if (h >= kNumVocHandles)
+ return;
+ }
+
for (int i = 0; _supportedCodes[i].fileext; ++i) {
strcpy(filenamebuffer, file);
strcat(filenamebuffer, _supportedCodes[i].fileext);
@@ -76,21 +84,26 @@ void Sound::voicePlay(const char *file) {
_currentVocFile = Audio::makeVOCStream(vocStream);
}
- if (_currentVocFile) {
- //_mixer->stopHandle(_vocHandle);
- _mixer->playInputStream(Audio::Mixer::kSpeechSoundType, &_vocHandle, _currentVocFile);
- }
+ _mixer->playInputStream(Audio::Mixer::kSpeechSoundType, &_vocHandles[h], _currentVocFile);
+
delete [] fileData;
fileSize = 0;
}
void Sound::voiceStop() {
- if (_mixer->isSoundHandleActive(_vocHandle))
- _mixer->stopHandle(_vocHandle);
+ for (int h = 0; h < kNumVocHandles; h++) {
+ if (_mixer->isSoundHandleActive(_vocHandles[h]))
+ _mixer->stopHandle(_vocHandles[h]);
+ }
}
bool Sound::voiceIsPlaying() {
- return _mixer->isSoundHandleActive(_vocHandle);
+ bool res = false;
+ for (int h = 0; h < kNumVocHandles; h++) {
+ if (_mixer->isSoundHandleActive(_vocHandles[h]))
+ res = true;
+ }
+ return res;
}
#pragma mark -
@@ -522,3 +535,4 @@ const Sound::SpeechCodecs Sound::_supportedCodes[] = {
} // end of namespace Kyra
+