diff options
author | Torbjörn Andersson | 2005-09-21 10:46:20 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2005-09-21 10:46:20 +0000 |
commit | 65959dafaa518187d2da0fba9eef9d4645b7347e (patch) | |
tree | f09269cdbd2145d630119498e4efd768adb52af8 | |
parent | d18ce8e2f0bcd82cbd68e7ce5bd8f417a4360222 (diff) | |
download | scummvm-rg350-65959dafaa518187d2da0fba9eef9d4645b7347e.tar.gz scummvm-rg350-65959dafaa518187d2da0fba9eef9d4645b7347e.tar.bz2 scummvm-rg350-65959dafaa518187d2da0fba9eef9d4645b7347e.zip |
This should keep IHNM from triggering an assertion in FLAC. But I'm not
sure since I don't have FLAC installed on this computer. The looping for
standalone tracks looked a little strange, too, so I've changed it.
svn-id: r18855
-rw-r--r-- | saga/music.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/saga/music.cpp b/saga/music.cpp index bf99444571..4425362263 100644 --- a/saga/music.cpp +++ b/saga/music.cpp @@ -383,26 +383,33 @@ void Music::play(uint32 resourceId, MusicFlags flags) { _player->stopMusic(); _mixer->stopHandle(_musicHandle); + int realTrackNumber; + + if (_vm->getGameType() == GType_ITE) { + if (flags == MUSIC_DEFAULT) { + if (resourceId == 13 || resourceId == 19) { + flags = MUSIC_NORMAL; + } else { + flags = MUSIC_LOOP; + } + } + realTrackNumber = resourceId - 8; + } else { + realTrackNumber = resourceId + 1; + } + // Try to open standalone digital track for (int i = 0; i < ARRAYSIZE(TRACK_FORMATS) - 1; ++i) - if (_track = TRACK_FORMATS[i].openTrackFunction(resourceId - 8)) { + if (_track = TRACK_FORMATS[i].openTrackFunction(realTrackNumber)) { break; } if (_track) { - _track->play(_mixer, &_musicHandle, (MUSIC_LOOP ? -1 : 1), 10000); + _track->play(_mixer, &_musicHandle, (flags == MUSIC_LOOP) ? -1 : 1, 10000); return; } if (_vm->getGameType() == GType_ITE) { if (resourceId >= 9 && resourceId <= 34) { - if (flags == MUSIC_DEFAULT) { - if ((resourceId == 13) || (resourceId == 19)) { - flags = MUSIC_NORMAL; - } else { - flags = MUSIC_LOOP; - } - } - if (_musicContext != NULL) { //TODO: check resource size audioStream = new RAWInputStream(_vm, _musicContext, resourceId - 9, flags == MUSIC_LOOP); |