diff options
author | Martin Kiewitz | 2010-01-02 08:15:01 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-01-02 08:15:01 +0000 |
commit | 513a56cd5e6aaa06f1b88d94c4284a808c99c992 (patch) | |
tree | a0e6f4593535baa8653bdb09eea10cdde3f586c6 /engines/sci | |
parent | 1f2c92076b8ab941a783920e16896ebebab212c2 (diff) | |
download | scummvm-rg350-513a56cd5e6aaa06f1b88d94c4284a808c99c992.tar.gz scummvm-rg350-513a56cd5e6aaa06f1b88d94c4284a808c99c992.tar.bz2 scummvm-rg350-513a56cd5e6aaa06f1b88d94c4284a808c99c992.zip |
SCI/newmusic: set default volume on MusicEntry creation, use volume selector sci1late (soundversion) only
svn-id: r46875
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/sfx/music.cpp | 2 | ||||
-rw-r--r-- | engines/sci/sfx/music.h | 2 | ||||
-rw-r--r-- | engines/sci/sfx/soundcmd.cpp | 13 |
3 files changed, 6 insertions, 11 deletions
diff --git a/engines/sci/sfx/music.cpp b/engines/sci/sfx/music.cpp index 065d4f101a..1a98a58a02 100644 --- a/engines/sci/sfx/music.cpp +++ b/engines/sci/sfx/music.cpp @@ -524,7 +524,7 @@ MusicEntry::MusicEntry() { signal = 0; prio = 0; loop = 0; - volume = 0; + volume = MUSIC_VOLUME_DEFAULT; hold = 0; pauseCounter = 0; diff --git a/engines/sci/sfx/music.h b/engines/sci/sfx/music.h index a1458b234c..6087202cb0 100644 --- a/engines/sci/sfx/music.h +++ b/engines/sci/sfx/music.h @@ -56,7 +56,7 @@ enum SoundStatus { kSoundPlaying = 3 }; -#define MUSIC_VOLUME_FOR_SCI0 127 +#define MUSIC_VOLUME_DEFAULT 127 #define MUSIC_VOLUME_MAX 127 class MidiParser_SCI; diff --git a/engines/sci/sfx/soundcmd.cpp b/engines/sci/sfx/soundcmd.cpp index 7b4a74ec10..467aa6f8bf 100644 --- a/engines/sci/sfx/soundcmd.cpp +++ b/engines/sci/sfx/soundcmd.cpp @@ -280,7 +280,8 @@ void SoundCommandParser::cmdInitSound(reg_t obj, int16 value) { newSound->soundObj = obj; newSound->loop = GET_SEL32V(_segMan, obj, loop); newSound->prio = GET_SEL32V(_segMan, obj, pri) & 0xFF; - newSound->volume = CLIP<int>(GET_SEL32V(_segMan, obj, vol), 0, MUSIC_VOLUME_MAX); + if (_soundVersion >= SCI_VERSION_1_LATE) + newSound->volume = CLIP<int>(GET_SEL32V(_segMan, obj, vol), 0, MUSIC_VOLUME_MAX); // Check if a track with the same sound object is already playing MusicEntry *oldSound = _music->getSlot(obj); @@ -418,10 +419,7 @@ void SoundCommandParser::cmdPlaySound(reg_t obj, int16 value) { musicSlot->loop = GET_SEL32V(_segMan, obj, loop); musicSlot->prio = GET_SEL32V(_segMan, obj, priority); - // vol selector doesnt get used before sci1late - if (_soundVersion < SCI_VERSION_1_LATE) - musicSlot->volume = MUSIC_VOLUME_FOR_SCI0; - else + if (_soundVersion >= SCI_VERSION_1_LATE) musicSlot->volume = GET_SEL32V(_segMan, obj, vol); _music->soundPlay(musicSlot); @@ -641,7 +639,6 @@ void SoundCommandParser::cmdFadeSound(reg_t obj, int16 value) { } int volume = musicSlot->volume; - PUT_SEL32V(_segMan, musicSlot->soundObj, vol, volume); musicSlot->fadeTo = _argv[2].toUint16(); musicSlot->fadeStep = volume > _argv[2].toUint16() ? -_argv[4].toUint16() : _argv[4].toUint16(); musicSlot->fadeTickerStep = _argv[3].toUint16() * 16667 / _music->soundGetTempo(); @@ -1018,10 +1015,8 @@ void SoundCommandParser::reconstructPlayList(int savegame_version) { (*i)->dataInc = GET_SEL32V(_segMan, (*i)->soundObj, dataInc); (*i)->signal = GET_SEL32V(_segMan, (*i)->soundObj, signal); - if (_soundVersion >= SCI_VERSION_1_EARLY) + if (_soundVersion >= SCI_VERSION_1_LATE) (*i)->volume = GET_SEL32V(_segMan, (*i)->soundObj, vol); - else - (*i)->volume = MUSIC_VOLUME_FOR_SCI0; } (*i)->soundRes = new SoundResource((*i)->resnum, _resMan, _soundVersion); |