[Scummvm-cvs-logs] SF.net SVN: scummvm: [25442] scummvm/trunk/engines/lure

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Fri Feb 9 11:59:16 CET 2007


Revision: 25442
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25442&view=rev
Author:   dreammaster
Date:     2007-02-09 02:59:15 -0800 (Fri, 09 Feb 2007)

Log Message:
-----------
Added 'room' command to show room information

Modified Paths:
--------------
    scummvm/trunk/engines/lure/debugger.cpp
    scummvm/trunk/engines/lure/debugger.h

Modified: scummvm/trunk/engines/lure/debugger.cpp
===================================================================
--- scummvm/trunk/engines/lure/debugger.cpp	2007-02-09 10:58:06 UTC (rev 25441)
+++ scummvm/trunk/engines/lure/debugger.cpp	2007-02-09 10:59:15 UTC (rev 25442)
@@ -40,6 +40,7 @@
 	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 @@
 	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

Modified: scummvm/trunk/engines/lure/debugger.h
===================================================================
--- scummvm/trunk/engines/lure/debugger.h	2007-02-09 10:58:06 UTC (rev 25441)
+++ scummvm/trunk/engines/lure/debugger.h	2007-02-09 10:59:15 UTC (rev 25442)
@@ -43,6 +43,7 @@
 	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


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list