From f444a68ffa7cab3530d76bbeab8b117f5e92bd21 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Mon, 10 Apr 2006 07:13:21 +0000 Subject: Merged o_playMusic() into o1_playTune(). svn-id: r21748 --- engines/simon/items.cpp | 56 +++++++++++++++++++++++-------------------------- engines/simon/simon.h | 1 - 2 files changed, 26 insertions(+), 31 deletions(-) (limited to 'engines/simon') diff --git a/engines/simon/items.cpp b/engines/simon/items.cpp index 0256a1189a..865f5cc6c8 100644 --- a/engines/simon/items.cpp +++ b/engines/simon/items.cpp @@ -1053,7 +1053,32 @@ void SimonEngine::o1_doClassIcons() { void SimonEngine::o1_playTune() { // 127: deals with music - o_playMusic(); + 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 (getGameType() == GType_SIMON2) { + int loop = getVarOrByte(); + + midi.setLoop(loop != 0); + if (_lastMusicPlayed != music) + _nextMusicToPlay = music; + else + midi.startTrack(track); + } else { + if (music != _lastMusicPlayed) { + _lastMusicPlayed = music; + loadMusic(music); + midi.startTrack(track); + } + } } void SimonEngine::o1_waitEndTune() { @@ -1939,35 +1964,6 @@ void SimonEngine::o_unlockZone() { _vgaBufStart = _vgaFileBufOrg; } -void SimonEngine::o_playMusic() { - 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 (getGameType() == GType_SIMON2) { - int loop = getVarOrByte(); - - midi.setLoop (loop != 0); - if (_lastMusicPlayed != music) - _nextMusicToPlay = music; - else - midi.startTrack (track); - } else { - if (music != _lastMusicPlayed) { - _lastMusicPlayed = music; - loadMusic (music); - midi.startTrack (track); - } - } -} - void SimonEngine::o_sync(uint a) { uint16 id = to16Wrapper(a); _lockWord |= 0x8000; diff --git a/engines/simon/simon.h b/engines/simon/simon.h index 248e45cd87..c4afffbdd4 100644 --- a/engines/simon/simon.h +++ b/engines/simon/simon.h @@ -574,7 +574,6 @@ protected: void o_waitForSync(uint a); void skipSpeech(); void o_sync(uint a); - void o_playMusic(); void o_saveGame(); void o_loadGame(); void o_confirmQuit(); -- cgit v1.2.3