aboutsummaryrefslogtreecommitdiff
path: root/engines/voyeur/debugger.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2014-02-02 20:28:24 -0500
committerPaul Gilbert2014-02-02 20:28:24 -0500
commitf88985dc649b81e13490d7f3f949838a9b6680c9 (patch)
treec4af9cb8f0e55f19ad8c1e9dc66e2e8751735750 /engines/voyeur/debugger.cpp
parentff68d8f89a8d992e51f52549673d4943e0fb998e (diff)
downloadscummvm-rg350-f88985dc649b81e13490d7f3f949838a9b6680c9.tar.gz
scummvm-rg350-f88985dc649b81e13490d7f3f949838a9b6680c9.tar.bz2
scummvm-rg350-f88985dc649b81e13490d7f3f949838a9b6680c9.zip
VOYEUR: Added debugger command to show mouse position
Diffstat (limited to 'engines/voyeur/debugger.cpp')
-rw-r--r--engines/voyeur/debugger.cpp57
1 files changed, 57 insertions, 0 deletions
diff --git a/engines/voyeur/debugger.cpp b/engines/voyeur/debugger.cpp
index 546691b3f0..8fdcf20823 100644
--- a/engines/voyeur/debugger.cpp
+++ b/engines/voyeur/debugger.cpp
@@ -32,9 +32,12 @@ Debugger::Debugger() : GUI::Debugger() {
DCmd_Register("continue", WRAP_METHOD(Debugger, Cmd_Exit));
DCmd_Register("exit", WRAP_METHOD(Debugger, Cmd_Exit));
DCmd_Register("time", WRAP_METHOD(Debugger, Cmd_Time));
+ DCmd_Register("hotspots", WRAP_METHOD(Debugger, Cmd_Hotspots));
+ DCmd_Register("mouse", WRAP_METHOD(Debugger, Cmd_Mouse));
// Set fields
_isTimeActive = true;
+ _showMousePosition = false;
}
bool Debugger::Cmd_Time(int argc, const char **argv) {
@@ -90,4 +93,58 @@ bool Debugger::Cmd_Time(int argc, const char **argv) {
return true;
}
+bool Debugger::Cmd_Hotspots(int argc, const char **argv) {
+ BoltEntry &boltEntry = _vm->_bVoy->boltEntry(_vm->_playStampGroupId + 1);
+ if (!boltEntry._rectResource) {
+ DebugPrintf("No hotspots available\n");
+ } else {
+ Common::Array<RectEntry> &hotspots = boltEntry._rectResource->_entries;
+
+ for (uint hotspotIdx = 0; hotspotIdx < hotspots.size(); ++hotspotIdx) {
+ Common::String pos = Common::String::format("(%d,%d->%d,%d)",
+ hotspots[hotspotIdx].left, hotspots[hotspotIdx].top,
+ hotspots[hotspotIdx].right, hotspots[hotspotIdx].bottom);
+
+ for (int arrIndex = 0; arrIndex < 3; ++arrIndex) {
+ if (_vm->_voy._audioHotspotTimes._min[arrIndex][hotspotIdx] != 9999) {
+ DebugPrintf("Hotspot %d %s Audio slot %d, time: %d to %d\n",
+ hotspotIdx, pos.c_str(), arrIndex,
+ _vm->_voy._audioHotspotTimes._min[arrIndex][hotspotIdx],
+ _vm->_voy._audioHotspotTimes._max[arrIndex][hotspotIdx]);
+ }
+
+ if (_vm->_voy._evidenceHotspotTimes._min[arrIndex][hotspotIdx] != 9999) {
+ DebugPrintf("Hotspot %d %s Evidence slot %d, time: %d to %d\n",
+ hotspotIdx, pos.c_str(), arrIndex,
+ _vm->_voy._evidenceHotspotTimes._min[arrIndex][hotspotIdx],
+ _vm->_voy._evidenceHotspotTimes._max[arrIndex][hotspotIdx]);
+ }
+ }
+
+ for (int arrIndex = 0; arrIndex < 8; ++arrIndex) {
+ if (_vm->_voy._videoHotspotTimes._min[arrIndex][hotspotIdx] != 9999) {
+ DebugPrintf("Hotspot %d %s Video slot %d, time: %d to %d\n",
+ hotspotIdx, pos.c_str(), arrIndex,
+ _vm->_voy._videoHotspotTimes._min[arrIndex][hotspotIdx],
+ _vm->_voy._videoHotspotTimes._max[arrIndex][hotspotIdx]);
+ }
+ }
+ }
+ }
+
+ DebugPrintf("\n");
+ return true;
+}
+
+bool Debugger::Cmd_Mouse(int argc, const char **argv) {
+ if (argc < 2) {
+ DebugPrintf("mouse [ on | off ]\n");
+ } else {
+ _showMousePosition = !strcmp(argv[1], "on");
+ DebugPrintf("Mouse position is now %s\n", _showMousePosition ? "on" : "off");
+ }
+
+ return true;
+}
+
} // End of namespace Voyeur