aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/debugger.cpp
diff options
context:
space:
mode:
authorThanasis Antoniou2019-05-27 14:16:03 +0300
committerThanasis Antoniou2019-05-29 12:08:24 +0300
commita041a291112433d014551c409cc48c629a077a09 (patch)
treec915137dd41254dc00dddcab2b0c74f78633e4bb /engines/bladerunner/debugger.cpp
parent8999b95053c6a22d4b4d639c584f1ad7513a5785 (diff)
downloadscummvm-rg350-a041a291112433d014551c409cc48c629a077a09.tar.gz
scummvm-rg350-a041a291112433d014551c409cc48c629a077a09.tar.bz2
scummvm-rg350-a041a291112433d014551c409cc48c629a077a09.zip
BLADERUNNER: Added click debugger command
Shows mouse click pos (x,y,z) and detected clickable region/actor/item/object id underneath
Diffstat (limited to 'engines/bladerunner/debugger.cpp')
-rw-r--r--engines/bladerunner/debugger.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/engines/bladerunner/debugger.cpp b/engines/bladerunner/debugger.cpp
index 593ecff9b3..633df5eff5 100644
--- a/engines/bladerunner/debugger.cpp
+++ b/engines/bladerunner/debugger.cpp
@@ -107,6 +107,7 @@ Debugger::Debugger(BladeRunnerEngine *vm) : GUI::Debugger() {
_playFullVk = false;
_showStatsVk = false;
_showMazeScore = false;
+ _showMouseClickInfo = false;
registerCmd("anim", WRAP_METHOD(Debugger, cmdAnimation));
registerCmd("health", WRAP_METHOD(Debugger, cmdHealth));
@@ -131,6 +132,7 @@ Debugger::Debugger(BladeRunnerEngine *vm) : GUI::Debugger() {
registerCmd("object", WRAP_METHOD(Debugger, cmdObject));
registerCmd("item", WRAP_METHOD(Debugger, cmdItem));
registerCmd("region", WRAP_METHOD(Debugger, cmdRegion));
+ registerCmd("click", WRAP_METHOD(Debugger, cmdClick));
#if BLADERUNNER_ORIGINAL_BUGS
#else
registerCmd("effect", WRAP_METHOD(Debugger, cmdEffect));
@@ -1735,6 +1737,36 @@ bool Debugger::cmdRegion(int argc, const char **argv) {
return true;
}
+/**
+* Toggle showing mouse click info in the text console (not the debugger window)
+*/
+bool Debugger::cmdClick(int argc, const char **argv) {
+ bool invalidSyntax = false;
+
+ if (argc != 2) {
+ invalidSyntax = true;
+ } else {
+ //
+ // set a debug variable to enable showing the mouse click info
+ //
+ Common::String argName = argv[1];
+ argName.toLowercase();
+ if (argc == 2 && argName == "toggle") {
+ _showMouseClickInfo = !_showMouseClickInfo;
+ debugPrintf("Showing mouse click info = %s\n", _showMouseClickInfo ? "True":"False");
+ return false; // close the debugger console
+ } else {
+ invalidSyntax = true;
+ }
+ }
+
+ if (invalidSyntax) {
+ debugPrintf("Toggle showing mouse info (on mouse click) in the text console\n");
+ debugPrintf("Usage: %s toggle\n", argv[0]);
+ }
+ return true;
+}
+
#if BLADERUNNER_ORIGINAL_BUGS
#else
bool Debugger::cmdEffect(int argc, const char **argv) {