[Scummvm-cvs-logs] SF.net SVN: scummvm:[42154] scummvm/trunk/engines/gob/hotspots.cpp

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Sun Jul 5 23:40:21 CEST 2009


Revision: 42154
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42154&view=rev
Author:   drmccoy
Date:     2009-07-05 21:40:20 +0000 (Sun, 05 Jul 2009)

Log Message:
-----------
Adding some hotspot debug messages

Modified Paths:
--------------
    scummvm/trunk/engines/gob/hotspots.cpp

Modified: scummvm/trunk/engines/gob/hotspots.cpp
===================================================================
--- scummvm/trunk/engines/gob/hotspots.cpp	2009-07-05 21:39:55 UTC (rev 42153)
+++ scummvm/trunk/engines/gob/hotspots.cpp	2009-07-05 21:40:20 UTC (rev 42154)
@@ -215,6 +215,10 @@
 		// Remember the current script
 		spot.script = _vm->_game->_script;
 
+		debugC(1, kDebugHotspots, "Adding hotspot %03d: %3d+%3d+%3d+%3d - %04X, %04X, %04X - %5d, %5d, %5d",
+				i, spot.left, spot.top, spot.right, spot.bottom,
+				spot.id, spot.key, spot.flags, spot.funcEnter, spot.funcLeave, spot.funcPos);
+
 		return i;
 	}
 
@@ -224,8 +228,10 @@
 
 void Hotspots::remove(uint16 id) {
 	for (int i = 0; i < kHotspotCount; i++) {
-		if (_hotspots[i].id == id)
+		if (_hotspots[i].id == id) {
+			debugC(1, kDebugHotspots, "Removing hotspot %d: %X", i, id);
 			_hotspots[i].clear();
+		}
 	}
 }
 
@@ -233,12 +239,16 @@
 	for (int i = 0; i < kHotspotCount; i++) {
 		Hotspot &spot = _hotspots[i];
 
-		if (spot.getState() == state)
+		if (spot.getState() == state) {
+			debugC(1, kDebugHotspots, "Removing hotspot %d: %X (by state %X)", i, spot.id, state);
 			spot.clear();
+		}
 	}
 }
 
 void Hotspots::recalculate(bool force) {
+	debugC(5, kDebugHotspots, "Recalculating hotspots");
+
 	for (int i = 0; (i < kHotspotCount) && !_hotspots[i].isEnd(); i++) {
 		Hotspot &spot = _hotspots[i];
 
@@ -302,6 +312,8 @@
 }
 
 void Hotspots::push(uint8 all, bool force) {
+	debugC(1, kDebugHotspots, "Pushing hotspots (%d, %d)", all, force);
+
 	// Should we push at all?
 	if (!_shouldPush && !force)
 		return;
@@ -366,6 +378,8 @@
 }
 
 void Hotspots::pop() {
+	debugC(1, kDebugHotspots, "Popping hotspots");
+
 	assert(!_stack.empty());
 
 	StackEntry backup = _stack.pop();
@@ -405,6 +419,8 @@
 }
 
 void Hotspots::call(uint16 offset) {
+	debugC(4, kDebugHotspots, "Calling hotspot function %d", offset);
+
 	_vm->_game->_script->call(offset);
 
 	_shouldPush = true;
@@ -424,6 +440,8 @@
 }
 
 void Hotspots::enter(uint16 index) {
+	debugC(2, kDebugHotspots, "Entering hotspot %d", index);
+
 	if (index >= kHotspotCount) {
 		warning("Hotspots::enter(): Index %d out of range", index);
 		return;
@@ -439,6 +457,8 @@
 }
 
 void Hotspots::leave(uint16 index) {
+	debugC(2, kDebugHotspots, "Leaving hotspot %d", index);
+
 	if (index >= kHotspotCount) {
 		warning("Hotspots::leave(): Index %d out of range", index);
 		return;


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