mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-30 23:43:10 +00:00
TOUCHE: Simplify external digital music support slightly.
Checked with valgrind and no leaks are evident. Thanks to LordHoto for suggesting these changes.
This commit is contained in:
parent
74cd6a4d26
commit
c14f45ee05
@ -3342,13 +3342,12 @@ void ToucheEngine::startMusic(int num) {
|
||||
_midiPlayer->play(_fData, size, true);
|
||||
} else {
|
||||
Common::String extMusicFilename = Common::String::format("track%02d", num);
|
||||
_extMusicFileStream = Audio::SeekableAudioStream::openStreamFile(extMusicFilename);
|
||||
if (!_extMusicFileStream) {
|
||||
Audio::SeekableAudioStream *extMusicFileStream = Audio::SeekableAudioStream::openStreamFile(extMusicFilename);
|
||||
if (!extMusicFileStream) {
|
||||
error("Unable to open %s for reading", extMusicFilename.c_str());
|
||||
}
|
||||
Audio::LoopingAudioStream *loopStream = new Audio::LoopingAudioStream(_extMusicFileStream, 0);
|
||||
_mixer->playStream(Audio::Mixer::kMusicSoundType, &_musicHandle, loopStream);
|
||||
_mixer->setChannelVolume(_musicHandle, _musicVolume);
|
||||
Audio::LoopingAudioStream *loopStream = new Audio::LoopingAudioStream(extMusicFileStream, 0);
|
||||
_mixer->playStream(Audio::Mixer::kMusicSoundType, &_musicHandle, loopStream, -1, _musicVolume);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -649,7 +649,6 @@ protected:
|
||||
|
||||
int _musicVolume;
|
||||
Audio::SoundHandle _musicHandle;
|
||||
Audio::SeekableAudioStream *_extMusicFileStream;
|
||||
|
||||
void initMusic();
|
||||
public: // To allow access from console
|
||||
|
Loading…
x
Reference in New Issue
Block a user