aboutsummaryrefslogtreecommitdiff
path: root/engines/simon
diff options
context:
space:
mode:
authorTorbjörn Andersson2006-04-10 07:13:21 +0000
committerTorbjörn Andersson2006-04-10 07:13:21 +0000
commitf444a68ffa7cab3530d76bbeab8b117f5e92bd21 (patch)
tree0446638e35b9d9cb305ae6760a667cb39cc14a52 /engines/simon
parent9dcd19778f330ae7088eaf0fc5891f3285842c83 (diff)
downloadscummvm-rg350-f444a68ffa7cab3530d76bbeab8b117f5e92bd21.tar.gz
scummvm-rg350-f444a68ffa7cab3530d76bbeab8b117f5e92bd21.tar.bz2
scummvm-rg350-f444a68ffa7cab3530d76bbeab8b117f5e92bd21.zip
Merged o_playMusic() into o1_playTune().
svn-id: r21748
Diffstat (limited to 'engines/simon')
-rw-r--r--engines/simon/items.cpp56
-rw-r--r--engines/simon/simon.h1
2 files changed, 26 insertions, 31 deletions
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();