From a24de29358a94941190044aaadaf3d2003486888 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Tue, 20 Jul 2010 11:17:33 +0000 Subject: [PATCH] SCI: renaming kDoSound(resume) to resumeAfterRestore kDoSound(resumeAfterRestore) is called right after restoring a saved game for sound-sci0 games, we already resume playing music inside restore, so we don't need to implement this at all svn-id: r51058 --- engines/sci/engine/kernel.cpp | 2 +- engines/sci/engine/kernel.h | 2 +- engines/sci/engine/ksound.cpp | 2 +- engines/sci/sound/soundcmd.cpp | 17 +++-------------- engines/sci/sound/soundcmd.h | 2 +- 5 files changed, 7 insertions(+), 18 deletions(-) diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index 189f6c2000e..5f919fee62b 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -337,7 +337,7 @@ static const SciKernelMapSubEntry kDoSound_subops[] = { { SIG_SOUNDSCI0, 4, MAP_CALL(DoSoundMute), "(i)", NULL }, { SIG_SOUNDSCI0, 5, MAP_CALL(DoSoundStop), "o", NULL }, { SIG_SOUNDSCI0, 6, MAP_CALL(DoSoundPause), "i", NULL }, - { SIG_SOUNDSCI0, 7, MAP_CALL(DoSoundResume), "", NULL }, + { SIG_SOUNDSCI0, 7, MAP_CALL(DoSoundResumeAfterRestore), "", NULL }, { SIG_SOUNDSCI0, 8, MAP_CALL(DoSoundMasterVolume), "(i)", NULL }, { SIG_SOUNDSCI0, 9, MAP_CALL(DoSoundUpdate), "o", NULL }, { SIG_SOUNDSCI0, 10, MAP_CALL(DoSoundFade), "o", NULL }, diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h index 81106625bf4..53b0dcb68e9 100644 --- a/engines/sci/engine/kernel.h +++ b/engines/sci/engine/kernel.h @@ -475,7 +475,7 @@ reg_t kDoSoundMute(EngineState *s, int argc, reg_t *argv); reg_t kDoSoundStop(EngineState *s, int argc, reg_t *argv); reg_t kDoSoundStopAll(EngineState *s, int argc, reg_t *argv); reg_t kDoSoundPause(EngineState *s, int argc, reg_t *argv); -reg_t kDoSoundResume(EngineState *s, int argc, reg_t *argv); +reg_t kDoSoundResumeAfterRestore(EngineState *s, int argc, reg_t *argv); reg_t kDoSoundMasterVolume(EngineState *s, int argc, reg_t *argv); reg_t kDoSoundUpdate(EngineState *s, int argc, reg_t *argv); reg_t kDoSoundFade(EngineState *s, int argc, reg_t *argv); diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp index 69ae68674ba..4e5ddc5e968 100644 --- a/engines/sci/engine/ksound.cpp +++ b/engines/sci/engine/ksound.cpp @@ -54,7 +54,7 @@ CREATE_DOSOUND_FORWARD(DoSoundMute) CREATE_DOSOUND_FORWARD(DoSoundStop) CREATE_DOSOUND_FORWARD(DoSoundStopAll) CREATE_DOSOUND_FORWARD(DoSoundPause) -CREATE_DOSOUND_FORWARD(DoSoundResume) +CREATE_DOSOUND_FORWARD(DoSoundResumeAfterRestore) CREATE_DOSOUND_FORWARD(DoSoundMasterVolume) CREATE_DOSOUND_FORWARD(DoSoundUpdate) CREATE_DOSOUND_FORWARD(DoSoundFade) diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index 8e750def4a5..8fa60e357bf 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -250,20 +250,9 @@ reg_t SoundCommandParser::kDoSoundPause(int argc, reg_t *argv, reg_t acc) { } // SCI0 only command -reg_t SoundCommandParser::kDoSoundResume(int argc, reg_t *argv, reg_t acc) { - // this doesn't seem to do what we think it's doing - // it's called with no arguments at all (just restore a game in qfg1) - return acc; - reg_t obj = argv[0]; - - MusicEntry *musicSlot = _music->getSlot(obj); - if (!musicSlot) { - warning("kDoSound(resume):: Slot not found (%04x:%04x)", PRINT_REG(obj)); - return acc; - } - - writeSelectorValue(_segMan, musicSlot->soundObj, SELECTOR(state), kSoundPlaying); - _music->soundResume(musicSlot); +// It's called right after restoring a game - it's responsible to kick off playing music again +// we don't need this at all, so we don't do anything here +reg_t SoundCommandParser::kDoSoundResumeAfterRestore(int argc, reg_t *argv, reg_t acc) { return acc; } diff --git a/engines/sci/sound/soundcmd.h b/engines/sci/sound/soundcmd.h index a8bc1eb280c..10915e8ea90 100644 --- a/engines/sci/sound/soundcmd.h +++ b/engines/sci/sound/soundcmd.h @@ -85,7 +85,7 @@ public: reg_t kDoSoundDummy(int argc, reg_t *argv, reg_t acc); reg_t kDoSoundMute(int argc, reg_t *argv, reg_t acc); reg_t kDoSoundPause(int argc, reg_t *argv, reg_t acc); - reg_t kDoSoundResume(int argc, reg_t *argv, reg_t acc); + reg_t kDoSoundResumeAfterRestore(int argc, reg_t *argv, reg_t acc); reg_t kDoSoundStop(int argc, reg_t *argv, reg_t acc); reg_t kDoSoundStopAll(int argc, reg_t *argv, reg_t acc); reg_t kDoSoundDispose(int argc, reg_t *argv, reg_t acc);