diff options
author | Filippos Karapetis | 2013-12-25 17:53:15 +0200 |
---|---|---|
committer | Filippos Karapetis | 2013-12-25 17:53:15 +0200 |
commit | 6bbec02a6e45a728b2c0fde9ce96ef8cd4304bb4 (patch) | |
tree | 3d0f1697652818854c45dc8ef1e349185e34bc97 /engines/fullpipe/console.cpp | |
parent | 962e2fd550bad06bf3328a0964d29f79b7da242d (diff) | |
download | scummvm-rg350-6bbec02a6e45a728b2c0fde9ce96ef8cd4304bb4.tar.gz scummvm-rg350-6bbec02a6e45a728b2c0fde9ce96ef8cd4304bb4.tar.bz2 scummvm-rg350-6bbec02a6e45a728b2c0fde9ce96ef8cd4304bb4.zip |
FULLPIPE: Add a new debug command, "scene"
This can be used to view the current scene, or teleport to another one
Diffstat (limited to 'engines/fullpipe/console.cpp')
-rw-r--r-- | engines/fullpipe/console.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/engines/fullpipe/console.cpp b/engines/fullpipe/console.cpp index 587f3dc6e6..06235d3eab 100644 --- a/engines/fullpipe/console.cpp +++ b/engines/fullpipe/console.cpp @@ -20,12 +20,29 @@ * */ +#include "fullpipe/constants.h" #include "fullpipe/fullpipe.h" +#include "fullpipe/gameloader.h" +#include "fullpipe/scene.h" namespace Fullpipe { -Console::Console(FullpipeEngine *vm) : GUI::Debugger() { - _vm = vm; +Console::Console(FullpipeEngine *vm) : GUI::Debugger(), _vm(vm) { + DCmd_Register("scene", WRAP_METHOD(Console, Cmd_Scene)); +} + +bool Console::Cmd_Scene(int argc, const char **argv) { + if (argc != 2) { + int sceneTag = _vm->_currentScene->_sceneId; + DebugPrintf("Current scene: %d (scene tag: %d)\n", _vm->getSceneFromTag(sceneTag), sceneTag); + DebugPrintf("Use %s <scene> to change the current scene\n", argv[0]); + return true; + } else { + int scene = _vm->convertScene(atoi(argv[1])); + _vm->_gameLoader->loadScene(scene); + _vm->_gameLoader->gotoScene(scene, TrubaLeft); + return false; + } } } // End of namespace Fullpipe |