[Scummvm-cvs-logs] scummvm master -> 6bbec02a6e45a728b2c0fde9ce96ef8cd4304bb4

bluegr bluegr at gmail.com
Wed Dec 25 16:53:50 CET 2013


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
6bbec02a6e FULLPIPE: Add a new debug command, "scene"


Commit: 6bbec02a6e45a728b2c0fde9ce96ef8cd4304bb4
    https://github.com/scummvm/scummvm/commit/6bbec02a6e45a728b2c0fde9ce96ef8cd4304bb4
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-12-25T07:53:15-08:00

Commit Message:
FULLPIPE: Add a new debug command, "scene"

This can be used to view the current scene, or teleport to another one

Changed paths:
    engines/fullpipe/console.cpp
    engines/fullpipe/console.h
    engines/fullpipe/fullpipe.h
    engines/fullpipe/scenes.cpp



diff --git a/engines/fullpipe/console.cpp b/engines/fullpipe/console.cpp
index 587f3dc..06235d3 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 9c03081..af2b511 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 75a7630..5e4389a 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 b4f95d3..96d9cba 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;






More information about the Scummvm-git-logs mailing list