diff options
author | Johannes Schickel | 2008-05-23 11:35:05 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-05-23 11:35:05 +0000 |
commit | 8d3116cf4a6982d4980855b01dd2a312c1a1f2ee (patch) | |
tree | be0341dca36ab079444fc4574ec2937de280d726 | |
parent | 16e7b030feca602573d0868e836e6104c2150b70 (diff) | |
download | scummvm-rg350-8d3116cf4a6982d4980855b01dd2a312c1a1f2ee.tar.gz scummvm-rg350-8d3116cf4a6982d4980855b01dd2a312c1a1f2ee.tar.bz2 scummvm-rg350-8d3116cf4a6982d4980855b01dd2a312c1a1f2ee.zip |
Cleanup.
svn-id: r32226
-rw-r--r-- | engines/kyra/sound.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/engines/kyra/sound.cpp b/engines/kyra/sound.cpp index a8566a7309..854e2de41f 100644 --- a/engines/kyra/sound.cpp +++ b/engines/kyra/sound.cpp @@ -67,9 +67,6 @@ bool Sound::voiceFileIsPresent(const char *file) { } bool Sound::voicePlay(const char *file, bool isSfx) { - uint32 fileSize = 0; - byte *fileData = 0; - bool found = false; char filenamebuffer[25]; int h = 0; @@ -88,28 +85,28 @@ bool Sound::voicePlay(const char *file, bool isSfx) { if (!stream) continue; audioStream = _supportedCodes[i].streamFunc(stream, true, 0, 0, 1); - found = true; break; } - if (!found) { + if (!audioStream) { strcpy(filenamebuffer, file); strcat(filenamebuffer, ".VOC"); - fileData = _vm->resource()->fileData(filenamebuffer, &fileSize); + uint32 fileSize = 0; + byte *fileData = _vm->resource()->fileData(filenamebuffer, &fileSize); if (!fileData) return false; Common::MemoryReadStream vocStream(fileData, fileSize); audioStream = Audio::makeVOCStream(vocStream); + + delete[] fileData; + fileSize = 0; } _soundChannels[h].file = file; _mixer->playInputStream(isSfx ? Audio::Mixer::kSFXSoundType : Audio::Mixer::kSpeechSoundType, &_soundChannels[h].channelHandle, audioStream); - delete[] fileData; - fileSize = 0; - return true; } |