diff options
author | Travis Howell | 2004-01-27 17:13:43 +0000 |
---|---|---|
committer | Travis Howell | 2004-01-27 17:13:43 +0000 |
commit | e6a7360d06adff5db538a178b9d897bb0509627c (patch) | |
tree | 7c0f57c91156fe0223ebab67d1a5a59b3c967617 | |
parent | 33e613b5c79a9960a5ba3af71c285d28b4623b0a (diff) | |
download | scummvm-rg350-e6a7360d06adff5db538a178b9d897bb0509627c.tar.gz scummvm-rg350-e6a7360d06adff5db538a178b9d897bb0509627c.tar.bz2 scummvm-rg350-e6a7360d06adff5db538a178b9d897bb0509627c.zip |
Add help
Add music option for Simon1
svn-id: r12636
-rw-r--r-- | simon/debugger.cpp | 43 | ||||
-rw-r--r-- | simon/debugger.h | 2 |
2 files changed, 41 insertions, 4 deletions
diff --git a/simon/debugger.cpp b/simon/debugger.cpp index 442db2e700..805ffa7af4 100644 --- a/simon/debugger.cpp +++ b/simon/debugger.cpp @@ -31,18 +31,20 @@ Debugger::Debugger(SimonEngine *vm) _vm = vm; DCmd_Register("exit", &Debugger::Cmd_Exit); + DCmd_Register("help", &Debugger::Cmd_Help); DCmd_Register("quit", &Debugger::Cmd_Exit); - DCmd_Register("playVoice", &Debugger::Cmd_PlayVoice); + DCmd_Register("voice", &Debugger::Cmd_PlayVoice); + DCmd_Register("music", &Debugger::Cmd_PlayMusic); } void Debugger::preEnter() { - _vm->midi.pause(1); + //_vm->midi.pause(1); } void Debugger::postEnter() { - _vm->midi.pause(0); + //_vm->midi.pause(0); } @@ -51,12 +53,45 @@ bool Debugger::Cmd_Exit(int argc, const char **argv) { return false; } +bool Debugger::Cmd_Help(int argc, const char **argv) { + // console normally has 39 line width + // wrap around nicely + int width = 0, size, i; + + DebugPrintf("Commands are:\n"); + for (i = 0 ; i < _dcmd_count ; i++) { + size = strlen(_dcmds[i].name) + 1; + + if ((width + size) >= 39) { + DebugPrintf("\n"); + width = size; + } else + width += size; + + DebugPrintf("%s ", _dcmds[i].name); + } + DebugPrintf("\n"); + return true; +} + +bool Debugger::Cmd_PlayMusic(int argc, const char **argv) { + uint music = atoi(argv[1]); + if (_vm->_game & GF_SIMON2) { + DebugPrintf("No support for Simon the Sorcerer 2\n"); + } else if (music > 0 && music < 35) { + _vm->loadMusic(music); + } else + DebugPrintf("Syntax: music <musicnum>\n"); + + return true; +} + bool Debugger::Cmd_PlayVoice(int argc, const char **argv) { if (argc > 1) { uint voice = atoi(argv[1]); _vm->_sound->playVoice(voice); } else - DebugPrintf("Syntax: playvoice <soundnum>\n"); + DebugPrintf("Syntax: voice <soundnum>\n"); return true; } diff --git a/simon/debugger.h b/simon/debugger.h index f1c82db1e4..301484c4d9 100644 --- a/simon/debugger.h +++ b/simon/debugger.h @@ -39,7 +39,9 @@ protected: virtual void postEnter(); bool Cmd_Exit(int argc, const char **argv); + bool Cmd_Help(int argc, const char **argv); bool Cmd_PlayVoice(int argc, const char **argv); + bool Cmd_PlayMusic(int argc, const char **argv); }; } // End of namespace Simon |