mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-07 11:27:44 +00:00
Cleanup.
svn-id: r32226
This commit is contained in:
parent
16e7b030fe
commit
8d3116cf4a
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user