diff options
author | Travis Howell | 2006-11-05 01:43:29 +0000 |
---|---|---|
committer | Travis Howell | 2006-11-05 01:43:29 +0000 |
commit | 94f1aab61a3b6466759b3ae13574079028c22956 (patch) | |
tree | eacea8aa18c8327d87840a10d0fd88acc175a6ba /engines | |
parent | 4f4be11631f42fb42c3153871a769f2e4eb1252a (diff) | |
download | scummvm-rg350-94f1aab61a3b6466759b3ae13574079028c22956.tar.gz scummvm-rg350-94f1aab61a3b6466759b3ae13574079028c22956.tar.bz2 scummvm-rg350-94f1aab61a3b6466759b3ae13574079028c22956.zip |
Music is disabled when under water in Elvira 1
svn-id: r24619
Diffstat (limited to 'engines')
-rw-r--r-- | engines/agos/agos.h | 1 | ||||
-rw-r--r-- | engines/agos/script_e1.cpp | 22 | ||||
-rw-r--r-- | engines/agos/script_s1.cpp | 11 |
3 files changed, 23 insertions, 11 deletions
diff --git a/engines/agos/agos.h b/engines/agos/agos.h index b16169c57a..84c8145e6d 100644 --- a/engines/agos/agos.h +++ b/engines/agos/agos.h @@ -1122,6 +1122,7 @@ public: void oe1_enableInput(); void oe1_setTime(); void oe1_ifTime(); + void oe1_playTune(); void oe1_bitClear(); void oe1_bitSet(); void oe1_bitTest(); diff --git a/engines/agos/script_e1.cpp b/engines/agos/script_e1.cpp index 6767afaba7..9acac2339f 100644 --- a/engines/agos/script_e1.cpp +++ b/engines/agos/script_e1.cpp @@ -152,7 +152,7 @@ void AGOSEngine::setupElvira1Opcodes(OpcodeProc *op) { op[260] = &AGOSEngine::oe1_ifTime; op[261] = &AGOSEngine::o_here; op[262] = &AGOSEngine::o_doClassIcons; - op[263] = &AGOSEngine::os1_playTune; + op[263] = &AGOSEngine::oe1_playTune; op[266] = &AGOSEngine::o_setAdjNoun; op[267] = &AGOSEngine::oe1_zoneDisk; op[268] = &AGOSEngine::o_saveUserGame; @@ -600,6 +600,26 @@ void AGOSEngine::oe1_ifTime() { setScriptCondition(false); } +void AGOSEngine::oe1_playTune() { + // 264: play tune + int music = getVarOrWord(); + int track = getVarOrWord(); + + if (music != _lastMusicPlayed) { + _lastMusicPlayed = music; + // No tune under water + if (music == 4) { + if (getPlatform() == Common::kPlatformAmiga) + _mixer->stopHandle(_modHandle); + else + midi.stop(); + } else { + loadMusic(music); + midi.startTrack(track); + } + } +} + void AGOSEngine::oe1_zoneDisk() { // 267: set disk number of each zone getVarOrWord(); diff --git a/engines/agos/script_s1.cpp b/engines/agos/script_s1.cpp index a8015f923e..ca0be02f4b 100644 --- a/engines/agos/script_s1.cpp +++ b/engines/agos/script_s1.cpp @@ -88,19 +88,10 @@ void AGOSEngine::os1_animate() { } void AGOSEngine::os1_playTune() { - // 127: deals with music + // 127: play tune int music = getVarOrWord(); int track = getVarOrWord(); - // Jamieson630: - // This appears to be a "load or play music" command. - // The music resource is specified, and optionally - // a track as well. Normally we see two calls being - // made, one to load the resource and another to - // actually start a track (so the resource is - // effectively preloaded so there's no latency when - // starting playback). - if (music != _lastMusicPlayed) { _lastMusicPlayed = music; loadMusic(music); |