aboutsummaryrefslogtreecommitdiff
path: root/engines/lure
diff options
context:
space:
mode:
authorPaul Gilbert2007-02-09 10:59:15 +0000
committerPaul Gilbert2007-02-09 10:59:15 +0000
commita5047b599a5151f691d1dac85c643a8adc4e8123 (patch)
tree15c103fce907471fb250db9d1d9b2cf8ab54359b /engines/lure
parent87b3f2c6d8da238c0d98ce87b24b31416e97ef82 (diff)
downloadscummvm-rg350-a5047b599a5151f691d1dac85c643a8adc4e8123.tar.gz
scummvm-rg350-a5047b599a5151f691d1dac85c643a8adc4e8123.tar.bz2
scummvm-rg350-a5047b599a5151f691d1dac85c643a8adc4e8123.zip
Added 'room' command to show room information
svn-id: r25442
Diffstat (limited to 'engines/lure')
-rw-r--r--engines/lure/debugger.cpp48
-rw-r--r--engines/lure/debugger.h1
2 files changed, 49 insertions, 0 deletions
diff --git a/engines/lure/debugger.cpp b/engines/lure/debugger.cpp
index 1d26556917..d4c0f6718b 100644
--- a/engines/lure/debugger.cpp
+++ b/engines/lure/debugger.cpp
@@ -40,6 +40,7 @@ Debugger::Debugger(): GUI::Debugger() {
DCmd_Register("give", WRAP_METHOD(Debugger, cmd_giveItem));
DCmd_Register("hotspots", WRAP_METHOD(Debugger, cmd_hotspots));
DCmd_Register("hotspot", WRAP_METHOD(Debugger, cmd_hotspot));
+ DCmd_Register("room", WRAP_METHOD(Debugger, cmd_room));
}
static int strToInt(const char *s) {
@@ -350,4 +351,51 @@ bool Debugger::cmd_hotspot(int argc, const char **argv) {
return true;
}
+bool Debugger::cmd_room(int argc, const char **argv) {
+ Resources &res = Resources::getReference();
+ StringData &strings = StringData::getReference();
+ char buffer[MAX_DESC_SIZE];
+
+ if (argc < 2) {
+ DebugPrintf("room <room_number>\n");
+ return true;
+ }
+ int roomNumber = strToInt(argv[1]);
+ RoomData *room = res.getRoom(roomNumber);
+ if (!room) {
+ DebugPrintf("Unknown room specified\n");
+ return true;
+ }
+
+ // Show the room details
+ strings.getString(roomNumber, buffer);
+ DebugPrintf("room #%d - %s\n", roomNumber, buffer);
+ strings.getString(room->descId, buffer);
+ DebugPrintf("%s\n", buffer);
+ DebugPrintf("Horizontal clipping = %d->%d walk area=(%d,%d)-(%d,%d)\n",
+ room->clippingXStart, room->clippingXEnd,
+ room->walkBounds.left, room->walkBounds.top,
+ room->walkBounds.right, room->walkBounds.bottom);
+
+ DebugPrintf("Exit hotspots:");
+ RoomExitHotspotList &exits = room->exitHotspots;
+ if (exits.empty())
+ DebugPrintf(" none\n");
+ else
+ {
+ RoomExitHotspotList::iterator i;
+ for (i = exits.begin(); i != exits.end(); ++i) {
+ RoomExitHotspotData *rec = *i;
+
+ DebugPrintf("\nArea - (%d,%d)-(%d,%d) Room=%d Cursor=%d Hotspot=%xh",
+ rec->xs, rec->ys, rec->xe, rec->ye, rec->destRoomNumber, rec->cursorNum, rec->hotspotId);
+ }
+
+ DebugPrintf("\n");
+ }
+
+ DebugPrintf("\n");
+ return true;
+}
+
} // End of namespace Lure
diff --git a/engines/lure/debugger.h b/engines/lure/debugger.h
index 6080c76fb5..2e0951fcd8 100644
--- a/engines/lure/debugger.h
+++ b/engines/lure/debugger.h
@@ -43,6 +43,7 @@ protected:
bool cmd_giveItem(int argc, const char **argv);
bool cmd_hotspots(int argc, const char **argv);
bool cmd_hotspot(int argc, const char **argv);
+ bool cmd_room(int argc, const char **argv);
};
} // End of namespace Lure