aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorJochen Hoenicke2003-08-15 11:18:21 +0000
committerJochen Hoenicke2003-08-15 11:18:21 +0000
commit9c378d2f22b57bc61ec7cc84ee41ff5d2a46dfa6 (patch)
tree26f9e329bfd7ce58c829e886e2691fbe39f4eade /scumm
parente1bc6493d858f569716cf2036732e8a1ddf36573 (diff)
downloadscummvm-rg350-9c378d2f22b57bc61ec7cc84ee41ff5d2a46dfa6.tar.gz
scummvm-rg350-9c378d2f22b57bc61ec7cc84ee41ff5d2a46dfa6.tar.bz2
scummvm-rg350-9c378d2f22b57bc61ec7cc84ee41ff5d2a46dfa6.zip
The imuse debugger commands now work with playerV2 too.
svn-id: r9704
Diffstat (limited to 'scumm')
-rw-r--r--scumm/debugger.cpp30
1 files changed, 24 insertions, 6 deletions
diff --git a/scumm/debugger.cpp b/scumm/debugger.cpp
index 84b6f5d3e7..d631df8047 100644
--- a/scumm/debugger.cpp
+++ b/scumm/debugger.cpp
@@ -24,6 +24,7 @@
#include "actor.h"
#include "boxes.h"
#include "imuse.h"
+#include "player_v2.h"
#include "debugger.h"
#include "common/util.h"
#include "common/file.h"
@@ -364,20 +365,24 @@ bool ScummDebugger::Cmd_Restart(int argc, const char **argv) {
}
bool ScummDebugger::Cmd_IMuse (int argc, const char **argv) {
- if (!_s->_imuse) {
+ if (!_s->_imuse && !_s->_playerV2) {
Debug_Printf ("No iMuse engine is active.\n");
return true;
}
if (argc > 1) {
if (!strcmp (argv[1], "panic")) {
- _s->_imuse->stop_all_sounds();
+ if (_s->_imuse)
+ _s->_imuse->stop_all_sounds();
+ if (_s->_playerV2)
+ _s->_playerV2->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"))) {
- _s->_imuse->property (IMuse::PROP_MULTI_MIDI, !strcmp (argv[2], "on"));
+ if (_s->_imuse)
+ _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");
@@ -391,7 +396,14 @@ bool ScummDebugger::Cmd_IMuse (int argc, const char **argv) {
sound = _s->_rnd.getRandomNumber (_s->getNumSounds());
}
_s->ensureResourceLoaded (rtSound, sound);
- _s->_imuse->startSound (sound);
+ if (_s->_imuse)
+ _s->_imuse->startSound (sound);
+ if (_s->_playerV2) {
+ byte *ptr = _s->getResourceAddress(rtSound, sound);
+ if (ptr)
+ _s->_playerV2->startSound (sound, ptr);
+ }
+
Debug_Printf ("Attempted to start music %d.\n", sound);
} else {
Debug_Printf ("Specify a music resource # from 1-255.\n");
@@ -400,10 +412,16 @@ bool ScummDebugger::Cmd_IMuse (int argc, const char **argv) {
} else if (!strcmp (argv[1], "stop")) {
if (argc > 2 && (!strcmp (argv[2], "all") || atoi (argv[2]) != 0)) {
if (!strcmp (argv[2], "all")) {
- _s->_imuse->stop_all_sounds();
+ if (_s->_imuse)
+ _s->_imuse->stop_all_sounds();
+ if (_s->_playerV2)
+ _s->_playerV2->stopAllSounds();
Debug_Printf ("Shutting down all music tracks.\n");
} else {
- _s->_imuse->stopSound (atoi (argv[2]));
+ 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]));
}
} else {