aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2009-12-22 00:35:27 +0000
committerFilippos Karapetis2009-12-22 00:35:27 +0000
commit0d82924fbe76efd27f4b439940cd916cfa2c65dd (patch)
treedde687ec79f81a004cf193d603ce0592cde4358b /engines
parentfd5e548bb2266b7dadf440df73f4dee2cd11d922 (diff)
downloadscummvm-rg350-0d82924fbe76efd27f4b439940cd916cfa2c65dd.tar.gz
scummvm-rg350-0d82924fbe76efd27f4b439940cd916cfa2c65dd.tar.bz2
scummvm-rg350-0d82924fbe76efd27f4b439940cd916cfa2c65dd.zip
Fixed looping sounds in the new sound code
svn-id: r46477
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/sfx/music.cpp4
-rw-r--r--engines/sci/sfx/soundcmd.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/engines/sci/sfx/music.cpp b/engines/sci/sfx/music.cpp
index 5fdf45db69..74ad9315d4 100644
--- a/engines/sci/sfx/music.cpp
+++ b/engines/sci/sfx/music.cpp
@@ -611,8 +611,8 @@ void MidiParser_SCI::parseNextEvent(EventInfo &info) {
info.ext.data = _position._play_pos;
_position._play_pos += info.length;
if (info.ext.type == 0x2F) {// end of track reached
- int loop = GET_SEL32V(_segMan, _pSnd->soundObj, loop);
- if (loop) {
+ int16 loop = GET_SEL32V(_segMan, _pSnd->soundObj, loop);
+ if (loop == 0xFFFF) {
jumpToTick(_loopTick);
PUT_SEL32V(_segMan, _pSnd->soundObj, loop, loop--);
} else {
diff --git a/engines/sci/sfx/soundcmd.cpp b/engines/sci/sfx/soundcmd.cpp
index 297e926f7e..973a86b406 100644
--- a/engines/sci/sfx/soundcmd.cpp
+++ b/engines/sci/sfx/soundcmd.cpp
@@ -779,7 +779,7 @@ void SoundCommandParser::cmdSetHandlePriority(reg_t obj, int16 value) {
void SoundCommandParser::cmdSetHandleLoop(reg_t obj, int16 value) {
if (!GET_SEL32(_segMan, obj, nodePtr).isNull()) {
- PUT_SEL32V(_segMan, obj, loop, value);
+ PUT_SEL32V(_segMan, obj, loop, value == 0xFFFF ? 0xFFFF : 1);
#ifdef USE_OLD_MUSIC_FUNCTIONS
SongHandle handle = FROBNICATE_HANDLE(obj);
_state->sfx_song_set_loops(handle, value);