aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorThanasis Antoniou2019-05-01 12:03:00 +0300
committerThanasis Antoniou2019-05-01 12:03:00 +0300
commitc572828132eb9c5dfbb4b596a663e95f25357ee0 (patch)
treeb05a0eb952535e7381880a32b407d1376bb9301f /engines
parent4cd7c3d19fd2cdf043c4cade221683b24b0e2afd (diff)
downloadscummvm-rg350-c572828132eb9c5dfbb4b596a663e95f25357ee0.tar.gz
scummvm-rg350-c572828132eb9c5dfbb4b596a663e95f25357ee0.tar.bz2
scummvm-rg350-c572828132eb9c5dfbb4b596a663e95f25357ee0.zip
BLADERUNNER: Debugger command show maze score
Diffstat (limited to 'engines')
-rw-r--r--engines/bladerunner/debugger.cpp54
-rw-r--r--engines/bladerunner/debugger.h4
-rw-r--r--engines/bladerunner/script/police_maze.cpp10
3 files changed, 64 insertions, 4 deletions
diff --git a/engines/bladerunner/debugger.cpp b/engines/bladerunner/debugger.cpp
index acafd68a59..4421a572f2 100644
--- a/engines/bladerunner/debugger.cpp
+++ b/engines/bladerunner/debugger.cpp
@@ -85,6 +85,7 @@ Debugger::Debugger(BladeRunnerEngine *vm) : GUI::Debugger() {
_viewWalkboxes = false;
_viewZBuffer = false;
_playFullVk = false;
+ _showMazeScore = false;
registerCmd("anim", WRAP_METHOD(Debugger, cmdAnimation));
registerCmd("draw", WRAP_METHOD(Debugger, cmdDraw));
@@ -104,6 +105,9 @@ Debugger::Debugger(BladeRunnerEngine *vm) : GUI::Debugger() {
registerCmd("overlay", WRAP_METHOD(Debugger, cmdOverlay));
registerCmd("subtitle", WRAP_METHOD(Debugger, cmdSubtitle));
registerCmd("vk", WRAP_METHOD(Debugger, cmdVk));
+ registerCmd("mazescore", WRAP_METHOD(Debugger, cmdMazeScore));
+ registerCmd("boundbox", WRAP_METHOD(Debugger, cmdBoundBox));
+ registerCmd("obstacle", WRAP_METHOD(Debugger, cmdObstacle));
}
Debugger::~Debugger() {
@@ -1076,6 +1080,56 @@ bool Debugger::cmdSubtitle(int argc, const char **argv) {
}
/**
+* Toggle showing Maze score on the fly as subtitle during the Police Maze Course
+*/
+bool Debugger::cmdMazeScore(int argc, const char **argv) {
+bool invalidSyntax = false;
+
+ if (argc != 2) {
+ invalidSyntax = true;
+ } else {
+ if (_vm->_scene->getSetId() != kSetPS10_PS11_PS12_PS13) {
+ debugPrintf("Error:Command %s is only valid during the Police Maze course\n", argv[0]);
+ return true;
+ }
+ //
+ // set a debug variable to enable showing the maze score
+ //
+ Common::String argName = argv[1];
+ argName.toLowercase();
+ if (argc == 2 && argName == "toggle") {
+ _showMazeScore = !_showMazeScore;
+ debugPrintf("Showing maze score = %s\n", _showMazeScore ? "True":"False");
+ } else {
+ invalidSyntax = true;
+ }
+ }
+
+ if (invalidSyntax) {
+ debugPrintf("Toggle showing the Maze Score as a subtitle during the Shooting Grounds Course\n");
+ debugPrintf("Usage: %s toggle", argv[0]);
+ }
+ return true;
+}
+
+/**
+* Change Bound box for objects to debug click box optimization
+*/
+bool Debugger::cmdBoundBox(int argc, const char **argv) {
+ // TODO
+ return true;
+}
+
+/**
+* Add or remove obstacle to debug some issues whereby existing obstacle layout does not prevent
+* characters from walking where they shouldn't
+*/
+bool Debugger::cmdObstacle(int argc, const char **argv) {
+ // TODO
+ return true;
+}
+
+/**
* Toggle playing a full VK session (full)
* Only available in VK mode
*/
diff --git a/engines/bladerunner/debugger.h b/engines/bladerunner/debugger.h
index 17255a7f30..2beee69c4b 100644
--- a/engines/bladerunner/debugger.h
+++ b/engines/bladerunner/debugger.h
@@ -54,6 +54,7 @@ public:
bool _viewWalkboxes;
bool _viewZBuffer;
bool _playFullVk;
+ bool _showMazeScore;
Debugger(BladeRunnerEngine *vm);
~Debugger();
@@ -75,6 +76,9 @@ public:
bool cmdSave(int argc, const char **argv);
bool cmdOverlay(int argc, const char **argv);
bool cmdSubtitle(int argc, const char **argv);
+ bool cmdMazeScore(int argc, const char **argv);
+ bool cmdBoundBox(int argc, const char **argv);
+ bool cmdObstacle(int argc, const char **argv);
bool cmdList(int argc, const char **argv);
bool cmdVk(int argc, const char **argv);
diff --git a/engines/bladerunner/script/police_maze.cpp b/engines/bladerunner/script/police_maze.cpp
index 99a5384e94..f5b9a1daa2 100644
--- a/engines/bladerunner/script/police_maze.cpp
+++ b/engines/bladerunner/script/police_maze.cpp
@@ -30,8 +30,8 @@
#include "bladerunner/script/police_maze.h"
#include "bladerunner/script/scene_script.h"
#include "bladerunner/time.h"
-//#include "bladerunner/subtitles.h" // Display score and debug info on-screen
-
+#include "bladerunner/subtitles.h"
+#include "bladerunner/debugger.h"
// ----------------------
// Maze point system info
// ----------------------
@@ -152,8 +152,10 @@ void PoliceMaze::tick() {
}
}
-// _vm->_subtitles->setGameSubsText(Common::String::format("Score: %02d", Global_Variable_Query(kVariablePoliceMazeScore)), true); // for debug purposes, show maze score
-// _vm->_subtitles->show(); // for debug purposes, show maze score
+ if (_vm->_debugger->_showMazeScore && _isActive && !_isEnding) {
+ _vm->_subtitles->setGameSubsText(Common::String::format("Score: %02d", Global_Variable_Query(kVariablePoliceMazeScore)), true);
+ _vm->_subtitles->show();
+ }
if (notFound && _isActive && !_isEnding) {
_isActive = false;