diff options
Diffstat (limited to 'scumm/debugger.cpp')
-rw-r--r-- | scumm/debugger.cpp | 77 |
1 files changed, 32 insertions, 45 deletions
diff --git a/scumm/debugger.cpp b/scumm/debugger.cpp index 1f7f48d8ed..8b9703b6cf 100644 --- a/scumm/debugger.cpp +++ b/scumm/debugger.cpp @@ -364,76 +364,63 @@ bool ScummDebugger::Cmd_Restart(int argc, const char **argv) { return false; } -bool ScummDebugger::Cmd_IMuse (int argc, const char **argv) { +bool ScummDebugger::Cmd_IMuse(int argc, const char **argv) { if (!_s->_imuse && !_s->_playerV2) { - Debug_Printf ("No iMuse engine is active.\n"); + Debug_Printf("No iMuse engine is active.\n"); return true; } if (argc > 1) { - if (!strcmp (argv[1], "panic")) { - if (_s->_imuse) - _s->_imuse->stopAllSounds(); - if (_s->_playerV2) - _s->_playerV2->stopAllSounds(); - Debug_Printf ("AAAIIIEEEEEE!\n"); - Debug_Printf ("Shutting down all music tracks\n"); + if (!strcmp(argv[1], "panic")) { + _s->_musicEngine->stopAllSounds(); + Debug_Printf("AAAIIIEEEEEE!\n"); + Debug_Printf("Shutting down all music tracks\n"); return true; } else if (!strcmp (argv[1], "multimidi")) { - if (argc > 2 && (!strcmp (argv[2], "on") || !strcmp (argv[2], "off"))) { + if (argc > 2 && (!strcmp(argv[2], "on") || !strcmp(argv[2], "off"))) { if (_s->_imuse) - _s->_imuse->property (IMuse::PROP_MULTI_MIDI, !strcmp (argv[2], "on")); - Debug_Printf ("MultiMidi mode switched %s.\n", argv[2]); + _s->_imuse->property(IMuse::PROP_MULTI_MIDI, !strcmp(argv[2], "on")); + Debug_Printf("MultiMidi mode switched %s.\n", argv[2]); } else { - Debug_Printf ("Specify \"on\" or \"off\" to switch.\n"); + Debug_Printf("Specify \"on\" or \"off\" to switch.\n"); } return true; - } else if (!strcmp (argv[1], "play")) { - if (argc > 2 && (!strcmp (argv[2], "random") || atoi (argv[2]) != 0)) { - int sound = atoi (argv[2]); - if (!strcmp (argv[2], "random")) { - Debug_Printf ("Selecting from %d songs...\n", _s->getNumSounds()); - sound = _s->_rnd.getRandomNumber (_s->getNumSounds()); + } else if (!strcmp(argv[1], "play")) { + if (argc > 2 && (!strcmp(argv[2], "random") || atoi(argv[2]) != 0)) { + int sound = atoi(argv[2]); + if (!strcmp(argv[2], "random")) { + Debug_Printf("Selecting from %d songs...\n", _s->getNumSounds()); + sound = _s->_rnd.getRandomNumber(_s->getNumSounds()); } _s->ensureResourceLoaded(rtSound, sound); - if (_s->_imuse) - _s->_imuse->startSound(sound); - if (_s->_playerV2) { - _s->_playerV2->startSound(sound); - } + _s->_musicEngine->startSound(sound); - Debug_Printf ("Attempted to start music %d.\n", sound); + Debug_Printf("Attempted to start music %d.\n", sound); } else { - Debug_Printf ("Specify a music resource # from 1-255.\n"); + Debug_Printf("Specify a music resource # from 1-255.\n"); } return true; - } else if (!strcmp (argv[1], "stop")) { - if (argc > 2 && (!strcmp (argv[2], "all") || atoi (argv[2]) != 0)) { - if (!strcmp (argv[2], "all")) { - if (_s->_imuse) - _s->_imuse->stopAllSounds(); - if (_s->_playerV2) - _s->_playerV2->stopAllSounds(); - Debug_Printf ("Shutting down all music tracks.\n"); + } else if (!strcmp(argv[1], "stop")) { + if (argc > 2 && (!strcmp(argv[2], "all") || atoi(argv[2]) != 0)) { + if (!strcmp(argv[2], "all")) { + _s->_musicEngine->stopAllSounds(); + Debug_Printf("Shutting down all music tracks.\n"); } else { - if (_s->_imuse) - _s->_imuse->stopSound(atoi (argv[2])); - if (_s->_playerV2) - _s->_playerV2->stopSound(atoi (argv[2])); - Debug_Printf ("Attempted to stop music %d.\n", atoi (argv[2])); + _s->_musicEngine->stopSound(atoi(argv[2])); + Debug_Printf("Attempted to stop music %d.\n", atoi(argv[2])); } } else { - Debug_Printf ("Specify a music resource # or \"all\".\n"); + Debug_Printf("Specify a music resource # or \"all\".\n"); } return true; } } - Debug_Printf ("Available iMuse commands:\n"); - Debug_Printf (" panic - Stop all music tracks\n"); - Debug_Printf (" multimidi on/off - Toggle dual MIDI drivers\n"); - Debug_Printf (" play # - Play a music resource\n"); - Debug_Printf (" stop # - Stop a music resource\n"); + Debug_Printf("Available iMuse commands:\n"); + Debug_Printf(" panic - Stop all music tracks\n"); + Debug_Printf(" multimidi on/off - Toggle dual MIDI drivers\n"); + Debug_Printf(" play # - Play a music resource\n"); + Debug_Printf(" stop # - Stop a music resource\n"); return true; } |