[Scummvm-git-logs] scummvm master -> c572828132eb9c5dfbb4b596a663e95f25357ee0

antoniou79 antoniou at cti.gr
Wed May 1 11:03:46 CEST 2019


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:
c572828132 BLADERUNNER: Debugger command show maze score


Commit: c572828132eb9c5dfbb4b596a663e95f25357ee0
    https://github.com/scummvm/scummvm/commit/c572828132eb9c5dfbb4b596a663e95f25357ee0
Author: Thanasis Antoniou (a.antoniou79 at gmail.com)
Date: 2019-05-01T12:03:00+03:00

Commit Message:
BLADERUNNER: Debugger command show maze score

Changed paths:
    engines/bladerunner/debugger.cpp
    engines/bladerunner/debugger.h
    engines/bladerunner/script/police_maze.cpp


diff --git a/engines/bladerunner/debugger.cpp b/engines/bladerunner/debugger.cpp
index acafd68..4421a57 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 17255a7..2beee69 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 99a5384..f5b9a1d 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;





More information about the Scummvm-git-logs mailing list