aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2013-12-25 17:53:15 +0200
committerFilippos Karapetis2013-12-25 17:53:15 +0200
commit6bbec02a6e45a728b2c0fde9ce96ef8cd4304bb4 (patch)
tree3d0f1697652818854c45dc8ef1e349185e34bc97
parent962e2fd550bad06bf3328a0964d29f79b7da242d (diff)
downloadscummvm-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
-rw-r--r--engines/fullpipe/console.cpp21
-rw-r--r--engines/fullpipe/console.h2
-rw-r--r--engines/fullpipe/fullpipe.h1
-rw-r--r--engines/fullpipe/scenes.cpp9
4 files changed, 31 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
diff --git a/engines/fullpipe/console.h b/engines/fullpipe/console.h
index 9c03081b2b..af2b5114ac 100644
--- a/engines/fullpipe/console.h
+++ b/engines/fullpipe/console.h
@@ -33,6 +33,8 @@ public:
private:
FullpipeEngine *_vm;
+
+ bool Cmd_Scene(int argc, const char **argv);
};
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h
index 75a7630456..5e4389af7b 100644
--- a/engines/fullpipe/fullpipe.h
+++ b/engines/fullpipe/fullpipe.h
@@ -238,6 +238,7 @@ public:
Scene *accessScene(int sceneId);
void setSceneMusicParameters(GameVar *var);
int convertScene(int scene);
+ int getSceneFromTag(int tag);
NGIArchive *_currArchive;
diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp
index b4f95d3715..96d9cba54f 100644
--- a/engines/fullpipe/scenes.cpp
+++ b/engines/fullpipe/scenes.cpp
@@ -214,6 +214,15 @@ int FullpipeEngine::convertScene(int scene) {
return scenes[scene - 1];
}
+int FullpipeEngine::getSceneFromTag(int tag) {
+ for (int i = 0; i < ARRAYSIZE(scenes); i++) {
+ if (scenes[i] == tag)
+ return i + 1;
+ }
+
+ return 1;
+}
+
bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
GameVar *sceneVar;
Common::Point sceneDim;