[Scummvm-cvs-logs] SF.net SVN: scummvm:[53826] scummvm/trunk/engines/hugo

strangerke at users.sourceforge.net strangerke at users.sourceforge.net
Mon Oct 25 16:03:01 CEST 2010


Revision: 53826
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53826&view=rev
Author:   strangerke
Date:     2010-10-25 14:03:01 +0000 (Mon, 25 Oct 2010)

Log Message:
-----------
HUGO: Add a debug channel for Object functions

Modified Paths:
--------------
    scummvm/trunk/engines/hugo/hugo.cpp
    scummvm/trunk/engines/hugo/hugo.h
    scummvm/trunk/engines/hugo/object.cpp
    scummvm/trunk/engines/hugo/object_v1d.cpp
    scummvm/trunk/engines/hugo/object_v1w.cpp
    scummvm/trunk/engines/hugo/object_v2d.cpp
    scummvm/trunk/engines/hugo/object_v3d.cpp

Modified: scummvm/trunk/engines/hugo/hugo.cpp
===================================================================
--- scummvm/trunk/engines/hugo/hugo.cpp	2010-10-25 13:31:01 UTC (rev 53825)
+++ scummvm/trunk/engines/hugo/hugo.cpp	2010-10-25 14:03:01 UTC (rev 53826)
@@ -77,6 +77,7 @@
 	DebugMan.addDebugChannel(kDebugFile, "File", "File IO debug level");
 	DebugMan.addDebugChannel(kDebugRoute, "Route", "Route debug level");
 	DebugMan.addDebugChannel(kDebugInventory, "Inventory", "Inventory debug level");
+	DebugMan.addDebugChannel(kDebugObject, "Object", "Object debug level");
 
 	for (int j = 0; j < NUM_FONTS; j++)
 		_arrayFont[j] = 0;

Modified: scummvm/trunk/engines/hugo/hugo.h
===================================================================
--- scummvm/trunk/engines/hugo/hugo.h	2010-10-25 13:31:01 UTC (rev 53825)
+++ scummvm/trunk/engines/hugo/hugo.h	2010-10-25 14:03:01 UTC (rev 53826)
@@ -72,14 +72,15 @@
 };
 
 enum HugoDebugChannels {
-	kDebugSchedule   = 1 <<  0,
-	kDebugEngine     = 1 <<  1,
-	kDebugDisplay    = 1 <<  2,
-	kDebugMouse      = 1 <<  3,
-	kDebugParser     = 1 <<  4,
-	kDebugFile       = 1 <<  5,
-	kDebugRoute      = 1 <<  6,
-	kDebugInventory  = 1 <<  7
+	kDebugSchedule  = 1 <<  0,
+	kDebugEngine    = 1 <<  1,
+	kDebugDisplay   = 1 <<  2,
+	kDebugMouse     = 1 <<  3,
+	kDebugParser    = 1 <<  4,
+	kDebugFile      = 1 <<  5,
+	kDebugRoute     = 1 <<  6,
+	kDebugInventory = 1 <<  7,
+	kDebugObject    = 1 <<  8
 };
 
 enum HugoGameFeatures {

Modified: scummvm/trunk/engines/hugo/object.cpp
===================================================================
--- scummvm/trunk/engines/hugo/object.cpp	2010-10-25 13:31:01 UTC (rev 53825)
+++ scummvm/trunk/engines/hugo/object.cpp	2010-10-25 14:03:01 UTC (rev 53826)
@@ -53,7 +53,7 @@
 
 void ObjectHandler::saveSeq(object_t *obj) {
 // Save sequence number and image number in given object
-	debugC(1, kDebugFile, "saveSeq");
+	debugC(1, kDebugObject, "saveSeq");
 
 	bool found = false;
 	for (int j = 0; !found && (j < obj->seqNumb); j++) {
@@ -72,7 +72,7 @@
 
 void ObjectHandler::restoreSeq(object_t *obj) {
 // Set up cur_seq_p from stored sequence and image number in object
-	debugC(1, kDebugFile, "restoreSeq");
+	debugC(1, kDebugObject, "restoreSeq");
 
 	seq_t *q = obj->seqList[obj->curSeqNum].seqPtr;
 	for (int j = 0; j < obj->curImageNum; j++)
@@ -83,7 +83,7 @@
 // If status.objid = -1, pick up objid, else use status.objid on objid,
 // if objid can't be picked up, use it directly
 void ObjectHandler::useObject(int16 objId) {
-	debugC(1, kDebugEngine, "useObject(%d)", objId);
+	debugC(1, kDebugObject, "useObject(%d)", objId);
 
 	char *verb;                                     // Background verb to use directly
 	object_t *obj = &_objects[objId];               // Ptr to object
@@ -142,7 +142,7 @@
 // Return object index of the topmost object under the cursor, or -1 if none
 // Objects are filtered if not "useful"
 int16 ObjectHandler::findObject(uint16 x, uint16 y) {
-	debugC(3, kDebugEngine, "findObject(%d, %d)", x, y);
+	debugC(3, kDebugObject, "findObject(%d, %d)", x, y);
 
 	int16     objIndex = -1;                        // Index of found object
 	uint16    y2Max = 0;                            // Greatest y2
@@ -183,7 +183,7 @@
 // Issue "Look at <object>" command
 // Note special case of swapped hero image
 void ObjectHandler::lookObject(object_t *obj) {
-	debugC(1, kDebugEngine, "lookObject");
+	debugC(1, kDebugObject, "lookObject");
 
 	if (obj == _vm->_hero)
 		// Hero swapped - look at other
@@ -194,7 +194,7 @@
 
 // Free all object images
 void ObjectHandler::freeObjects() {
-	debugC(1, kDebugEngine, "freeObjects");
+	debugC(1, kDebugObject, "freeObjects");
 
 	// Nothing to do if not allocated yet
 	if (_vm->_hero->seqList[0].seqPtr == 0)
@@ -220,7 +220,7 @@
 // increasing vertical position, using y+y2 as the baseline
 // Returns -1 if ay2 < by2 else 1 if ay2 > by2 else 0
 int ObjectHandler::y2comp(const void *a, const void *b) {
-	debugC(6, kDebugEngine, "y2comp");
+	debugC(6, kDebugObject, "y2comp");
 
 //	const object_t *p1 = &s_Engine->_objects[*(const byte *)a];
 //	const object_t *p2 = &s_Engine->_objects[*(const byte *)b];
@@ -251,7 +251,7 @@
 
 // Return TRUE if object being carried by hero
 bool ObjectHandler::isCarrying(uint16 wordIndex) {
-	debugC(1, kDebugParser, "isCarrying(%d)", wordIndex);
+	debugC(1, kDebugObject, "isCarrying(%d)", wordIndex);
 
 	for (int i = 0; i < _vm->_numObj; i++) {
 		if ((wordIndex == _objects[i].nounIndex) && _objects[i].carriedFl)
@@ -262,7 +262,7 @@
 
 // Describe any takeable objects visible in this screen
 void ObjectHandler::showTakeables() {
-	debugC(1, kDebugParser, "showTakeables");
+	debugC(1, kDebugObject, "showTakeables");
 
 	for (int j = 0; j < _vm->_numObj; j++) {
 		object_t *obj = &_objects[j];
@@ -276,7 +276,7 @@
 
 // Find a clear space around supplied object that hero can walk to
 bool ObjectHandler::findObjectSpace(object_t *obj, int16 *destx, int16 *desty) {
-	debugC(1, kDebugEngine, "findObjectSpace(obj, %d, %d)", *destx, *desty);
+	debugC(1, kDebugObject, "findObjectSpace(obj, %d, %d)", *destx, *desty);
 
 	seq_t *curImage = obj->currImagePtr;
 	int16 y = obj->y + curImage->y2 - 1;
@@ -318,6 +318,8 @@
 }
 
 void ObjectHandler::loadObject(Common::File &in) {
+	debugC(6, kDebugObject, "loadObject(&in)");
+
 // TODO: For Hugo3, if not in story mode, set _objects[2].state to 3
 	for (int varnt = 0; varnt < _vm->_numVariant; varnt++) {
 		uint16 numElem = in.readUint16BE();

Modified: scummvm/trunk/engines/hugo/object_v1d.cpp
===================================================================
--- scummvm/trunk/engines/hugo/object_v1d.cpp	2010-10-25 13:31:01 UTC (rev 53825)
+++ scummvm/trunk/engines/hugo/object_v1d.cpp	2010-10-25 14:03:01 UTC (rev 53826)
@@ -56,7 +56,7 @@
 // 2. Display new object frames/positions in dib
 // Finally, cycle any animating objects to next frame
 void ObjectHandler_v1d::updateImages() {
-	debugC(5, kDebugEngine, "updateImages");
+	debugC(5, kDebugObject, "updateImages");
 
 	// Initialise the index array to visible objects in current screen
 	int  num_objs = 0;
@@ -169,7 +169,7 @@
 // Update all object positions.  Process object 'local' events
 // including boundary events and collisions
 void ObjectHandler_v1d::moveObjects() {
-	debugC(4, kDebugEngine, "moveObjects");
+	debugC(4, kDebugObject, "moveObjects");
 
 	static int dxOld, dyOld;                        // previous directions for CHASEing
 
@@ -339,7 +339,7 @@
 // Swap all the images of one object with another.  Set hero_image (we make
 // the assumption for now that the first obj is always the HERO) to the object
 // number of the swapped image
-	debugC(1, kDebugSchedule, "swapImages(%d, %d)", objNumb1, objNumb2);
+	debugC(1, kDebugObject, "swapImages(%d, %d)", objNumb1, objNumb2);
 
 	seqList_t tmpSeqList[MAX_SEQUENCES];
 	int seqListSize = sizeof(seqList_t) * MAX_SEQUENCES;

Modified: scummvm/trunk/engines/hugo/object_v1w.cpp
===================================================================
--- scummvm/trunk/engines/hugo/object_v1w.cpp	2010-10-25 13:31:01 UTC (rev 53825)
+++ scummvm/trunk/engines/hugo/object_v1w.cpp	2010-10-25 14:03:01 UTC (rev 53826)
@@ -56,7 +56,7 @@
 // 2. Display new object frames/positions in dib
 // Finally, cycle any animating objects to next frame
 void ObjectHandler_v1w::updateImages() {
-	debugC(5, kDebugEngine, "updateImages");
+	debugC(5, kDebugObject, "updateImages");
 
 	// Initialise the index array to visible objects in current screen
 	int  num_objs = 0;
@@ -169,7 +169,7 @@
 // Update all object positions.  Process object 'local' events
 // including boundary events and collisions
 void ObjectHandler_v1w::moveObjects() {
-	debugC(4, kDebugEngine, "moveObjects");
+	debugC(4, kDebugObject, "moveObjects");
 
 	// If route mode enabled, do special route processing
 	if (_vm->getGameStatus().routeIndex >= 0)
@@ -349,7 +349,7 @@
 // Swap all the images of one object with another.  Set hero_image (we make
 // the assumption for now that the first obj is always the HERO) to the object
 // number of the swapped image
-	debugC(1, kDebugSchedule, "swapImages(%d, %d)", objNumb1, objNumb2);
+	debugC(1, kDebugObject, "swapImages(%d, %d)", objNumb1, objNumb2);
 
 	saveSeq(&_objects[objNumb1]);
 

Modified: scummvm/trunk/engines/hugo/object_v2d.cpp
===================================================================
--- scummvm/trunk/engines/hugo/object_v2d.cpp	2010-10-25 13:31:01 UTC (rev 53825)
+++ scummvm/trunk/engines/hugo/object_v2d.cpp	2010-10-25 14:03:01 UTC (rev 53826)
@@ -56,7 +56,7 @@
 // 2. Display new object frames/positions in dib
 // Finally, cycle any animating objects to next frame
 void ObjectHandler_v2d::updateImages() {
-	debugC(5, kDebugEngine, "updateImages");
+	debugC(5, kDebugObject, "updateImages");
 
 	// Initialise the index array to visible objects in current screen
 	int  num_objs = 0;
@@ -169,7 +169,7 @@
 // Update all object positions.  Process object 'local' events
 // including boundary events and collisions
 void ObjectHandler_v2d::moveObjects() {
-	debugC(4, kDebugEngine, "moveObjects");
+	debugC(4, kDebugObject, "moveObjects");
 
 	// Added to DOS version in order to handle mouse properly
 	// If route mode enabled, do special route processing

Modified: scummvm/trunk/engines/hugo/object_v3d.cpp
===================================================================
--- scummvm/trunk/engines/hugo/object_v3d.cpp	2010-10-25 13:31:01 UTC (rev 53825)
+++ scummvm/trunk/engines/hugo/object_v3d.cpp	2010-10-25 14:03:01 UTC (rev 53826)
@@ -54,7 +54,7 @@
 // Update all object positions.  Process object 'local' events
 // including boundary events and collisions
 void ObjectHandler_v3d::moveObjects() {
-	debugC(4, kDebugEngine, "moveObjects");
+	debugC(4, kDebugObject, "moveObjects");
 
 	// Added to DOS version in order to handle mouse properly
 	// If route mode enabled, do special route processing
@@ -235,7 +235,7 @@
 // Swap all the images of one object with another.  Set hero_image (we make
 // the assumption for now that the first obj is always the HERO) to the object
 // number of the swapped image
-	debugC(1, kDebugSchedule, "swapImages(%d, %d)", objNumb1, objNumb2);
+	debugC(1, kDebugObject, "swapImages(%d, %d)", objNumb1, objNumb2);
 
 	saveSeq(&_objects[objNumb1]);
 


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