[Scummvm-cvs-logs] scummvm master -> 6ac435099c0ccdeb55fc0e5c195b92d68ed9344e

sev- sev at scummvm.org
Wed Jul 27 23:37:22 CEST 2016


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
2d96b5f3e6 FULLPIPE: Started using debug channels
1fb5f55b70 FULLPIPE: Added more debug channels
6ac435099c FULLPIPE: Split all debug output by channels


Commit: 2d96b5f3e60969cdeb96cdcaaff44a90855bbab2
    https://github.com/scummvm/scummvm/commit/2d96b5f3e60969cdeb96cdcaaff44a90855bbab2
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-07-28T00:37:32+03:00

Commit Message:
FULLPIPE: Started using debug channels

Changed paths:
    engines/fullpipe/fullpipe.cpp
    engines/fullpipe/fullpipe.h
    engines/fullpipe/mgm.cpp
    engines/fullpipe/motion.cpp
    engines/fullpipe/scene.cpp



diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp
index c2aae9b..cef3d5c 100644
--- a/engines/fullpipe/fullpipe.cpp
+++ b/engines/fullpipe/fullpipe.cpp
@@ -24,6 +24,7 @@
 
 #include "common/archive.h"
 #include "common/config-manager.h"
+#include "common/debug-channels.h"
 #include "audio/mixer.h"
 
 #include "engines/util.h"
@@ -199,6 +200,8 @@ FullpipeEngine::~FullpipeEngine() {
 }
 
 void FullpipeEngine::initialize() {
+	DebugMan.addDebugChannel(kDebugPathfinding, "path", "Pathfinding");
+
 	_globalMessageQueueList = new GlobalMessageQueueList;
 	_behaviorManager = new BehaviorManager;
 
diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h
index fba61aa..afd4fd9 100644
--- a/engines/fullpipe/fullpipe.h
+++ b/engines/fullpipe/fullpipe.h
@@ -48,6 +48,11 @@ namespace Fullpipe {
 enum FullpipeGameFeatures {
 };
 
+enum AccessDebugChannels {
+	kDebugPathfinding = 1 << 0,
+	kDebugDrawing     = 1 << 1
+};
+
 class BehaviorManager;
 class BaseModalObject;
 class GameLoader;
diff --git a/engines/fullpipe/mgm.cpp b/engines/fullpipe/mgm.cpp
index ca2ec06..b5c7124 100644
--- a/engines/fullpipe/mgm.cpp
+++ b/engines/fullpipe/mgm.cpp
@@ -155,7 +155,7 @@ void MGM::rebuildTables(int objId) {
 	if (!obj)
 		return;
 
-	warning("WWW rebuild. idx: %d, size: %d", idx, obj->_staticsList.size() * obj->_staticsList.size());
+	debugC(1, kDebugPathfinding, "WWW rebuild. idx: %d, size: %d", idx, obj->_staticsList.size() * obj->_staticsList.size());
 	for (uint i = 0; i < obj->_staticsList.size(); i++) {
 		_items[idx]->statics.push_back((Statics *)obj->_staticsList[i]);
 
@@ -583,7 +583,7 @@ int MGM::refreshOffsets(int objectId, int idx1, int idx2) {
 		int from = getStaticsIndexById(idx, idx1);
 		int to = getStaticsIndexById(idx, idx2);
 
-		warning("WWW 6, want idx: %d, off: %d", idx, from + to * _items[idx]->statics.size());
+		debugC(1, kDebugPathfinding, "WWW 6, want idx: %d, off: %d", idx, from + to * _items[idx]->statics.size());
 		MGMSubItem *sub = _items[idx]->subItems[from + to * _items[idx]->statics.size()];
 
 		if (sub->movement) {
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index 81424db..f030446 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -186,7 +186,7 @@ MessageQueue *MctlCompound::startMove(StaticANIObject *ani, int sourceX, int sou
 	if (sourceIdx == -1)
 		return 0;
 
-	warning("WWW 2");
+	debugC(1, kDebugPathfinding, "WWW 2");
 	if (idx == sourceIdx)
 		return _motionControllers[idx]->_motionControllerObj->startMove(ani, sourceX, sourceY, fuzzyMatch, staticsId);
 
@@ -1634,7 +1634,7 @@ int MovGraph2::getItemSubIndexByMGM(int index, StaticANIObject *ani) {
 		int min = 0;
 
 		for (int i = 0; i < 4; i++) {
-			warning("WWW 5");
+			debugC(1, kDebugPathfinding, "WWW 5");
 			int tmp = _mgm.refreshOffsets(ani->_id, ani->_statics->_staticsId, _items2[index]->_subItems[i]._staticsId1);
 
 			if (tmp >= 0 && (minidx == -1 || tmp < min)) {
@@ -2052,7 +2052,7 @@ MessageQueue *MovGraph2::startMove(StaticANIObject *ani, int xpos, int ypos, int
 	if (ani->_flags & 0x100)
 		return 0;
 
-	warning("WWW 3");
+	debugC(1, kDebugPathfinding, "WWW 3");
 	MessageQueue *mq = doWalkTo(ani, xpos, ypos, fuzzyMatch, staticsId);
 
 	if (!mq)
@@ -2121,7 +2121,7 @@ MessageQueue *MovGraph2::doWalkTo(StaticANIObject *obj, int xpos, int ypos, int
 	bool subMgm = false;
 
 	if (idxsub == -1) {
-		warning("WWW 4");
+		debugC(1, kDebugPathfinding, "WWW 4");
 		idxsub = getItemSubIndexByMGM(idx, obj);
 		subMgm = true;
 
diff --git a/engines/fullpipe/scene.cpp b/engines/fullpipe/scene.cpp
index 5a3fbe3..067fbff 100644
--- a/engines/fullpipe/scene.cpp
+++ b/engines/fullpipe/scene.cpp
@@ -654,7 +654,7 @@ void Scene::drawContent(int minPri, int maxPri, bool drawBg) {
 		g_fp->_globalPalette = _palette->_data;
 	}
 
-	debug(1, "Scene::drawContent(>%d, <%d, %d)", minPri, maxPri, drawBg);
+	debugC(1, kDebugDrawing, "Scene::drawContent(>%d, <%d, %d)", minPri, maxPri, drawBg);
 
 	if (_picObjList.size() > 2) { // We need to z-sort them
 		objectList_sortByPriority(_picObjList, true);
@@ -666,11 +666,11 @@ void Scene::drawContent(int minPri, int maxPri, bool drawBg) {
 	if (maxPri == -1)
 		maxPri = 60000;
 
-	debug(1, "-> Scene::drawContent(>%d, <%d, %d)", minPri, maxPri, drawBg);
+	debugC(1, kDebugDrawing, "-> Scene::drawContent(>%d, <%d, %d)", minPri, maxPri, drawBg);
 
 	Common::Point point;
 
-	debug(1, "_bigPict: %d objlist: %d", _bigPictureArray1Count, _picObjList.size());
+	debugC(1, kDebugDrawing, "_bigPict: %d objlist: %d", _bigPictureArray1Count, _picObjList.size());
 
 	if (drawBg && _bigPictureArray1Count && _picObjList.size()) {
 


Commit: 1fb5f55b704ae57ddc3c103a22ab466cf93aa94a
    https://github.com/scummvm/scummvm/commit/1fb5f55b704ae57ddc3c103a22ab466cf93aa94a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-07-28T00:37:32+03:00

Commit Message:
FULLPIPE: Added more debug channels

Changed paths:
    engines/fullpipe/fullpipe.cpp
    engines/fullpipe/fullpipe.h
    engines/fullpipe/motion.cpp
    engines/fullpipe/scene.cpp
    engines/fullpipe/statics.cpp



diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp
index cef3d5c..fcfe78a 100644
--- a/engines/fullpipe/fullpipe.cpp
+++ b/engines/fullpipe/fullpipe.cpp
@@ -201,6 +201,8 @@ FullpipeEngine::~FullpipeEngine() {
 
 void FullpipeEngine::initialize() {
 	DebugMan.addDebugChannel(kDebugPathfinding, "path", "Pathfinding");
+	DebugMan.addDebugChannel(kDebugDrawing, "drawing", "Drawing");
+	DebugMan.addDebugChannel(kDebugLoading, "loading", "Scene loading");
 
 	_globalMessageQueueList = new GlobalMessageQueueList;
 	_behaviorManager = new BehaviorManager;
diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h
index afd4fd9..ccbbf60 100644
--- a/engines/fullpipe/fullpipe.h
+++ b/engines/fullpipe/fullpipe.h
@@ -50,7 +50,8 @@ enum FullpipeGameFeatures {
 
 enum AccessDebugChannels {
 	kDebugPathfinding = 1 << 0,
-	kDebugDrawing     = 1 << 1
+	kDebugDrawing     = 1 << 1,
+	kDebugLoading     = 1 << 2
 };
 
 class BehaviorManager;
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index f030446..2829bdc 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -32,7 +32,7 @@ namespace Fullpipe {
 bool MotionController::load(MfcArchive &file) {
 	// Is originally empty	file.readClass();
 
-	debug(5, "MotionController::load()");
+	debugC(5, kDebugLoading, "MotionController::load()");
 
 	return true;
 }
@@ -80,23 +80,23 @@ MovGraphLink *MotionController::getLinkByName(const char *name) {
 }
 
 bool MctlCompound::load(MfcArchive &file) {
-	debug(5, "MctlCompound::load()");
+	debugC(5, kDebugLoading, "MctlCompound::load()");
 
 	int count = file.readUint32LE();
 
-	debug(6, "MctlCompound::count = %d", count);
+	debugC(6, kDebugLoading, "MctlCompound::count = %d", count);
 
 	for (int i = 0; i < count; i++) {
-		debug(6, "CompoundArray[%d]", i);
+		debugC(6, kDebugLoading, "CompoundArray[%d]", i);
 		MctlItem *obj = new MctlItem();
 
 		obj->_motionControllerObj = (MotionController *)file.readClass();
 
 		int count1 = file.readUint32LE();
 
-		debug(6, "ConnectionPoint::count: %d", count1);
+		debugC(6, kDebugLoading, "ConnectionPoint::count: %d", count1);
 		for (int j = 0; j < count1; j++) {
-			debug(6, "ConnectionPoint[%d]", j);
+			debugC(6, kDebugLoading, "ConnectionPoint[%d]", j);
 			MctlConnectionPoint *obj1 = (MctlConnectionPoint *)file.readClass();
 
 			obj->_connectionPoints.push_back(obj1);
@@ -105,7 +105,7 @@ bool MctlCompound::load(MfcArchive &file) {
 		obj->_field_20 = file.readUint32LE();
 		obj->_field_24 = file.readUint32LE();
 
-		debug(6, "graphReact");
+		debugC(6, kDebugLoading, "graphReact");
 		obj->_movGraphReactObj = (MovGraphReact *)file.readClass();
 
 		_motionControllers.push_back(obj);
@@ -708,11 +708,11 @@ void MovInfo1::clear() {
 }
 
 bool MctlCompoundArray::load(MfcArchive &file) {
-	debug(5, "MctlCompoundArray::load()");
+	debugC(5, kDebugLoading, "MctlCompoundArray::load()");
 
 	int count = file.readUint32LE();
 
-	debug(0, "MctlCompoundArray::count = %d", count);
+	debugC(0, kDebugLoading, "MctlCompoundArray::count = %d", count);
 
 	assert(0);
 
@@ -771,7 +771,7 @@ MovGraph::~MovGraph() {
 }
 
 bool MovGraph::load(MfcArchive &file) {
-	debug(5, "MovGraph::load()");
+	debugC(5, kDebugLoading, "MovGraph::load()");
 
 	_links.load(file);
 	_nodes.load(file);
@@ -2094,7 +2094,7 @@ MessageQueue *MovGraph2::doWalkTo(StaticANIObject *obj, int xpos, int ypos, int
 	PicAniInfo picAniInfo;
 	Common::Point point;
 
-	debug(0, "MovGraph2::doWalkTo(%d, %d, %d, %d, %d)", obj->_id, xpos, ypos, fuzzyMatch, staticsId);
+	debugC(0, kDebugPathfinding, "MovGraph2::doWalkTo(%d, %d, %d, %d, %d)", obj->_id, xpos, ypos, fuzzyMatch, staticsId);
 
 	int idx = getItemIndexByGameObjectId(obj->_id);
 
@@ -2227,7 +2227,7 @@ MessageQueue *MovGraph2::doWalkTo(StaticANIObject *obj, int xpos, int ypos, int
 	Common::Array<MovGraphLink *> tempLinkList;
 	double minPath = findMinPath(&linkInfoSource, &linkInfoDest, &tempLinkList);
 
-	debug(0, "MovGraph2::doWalkTo(): path: %g  parts: %d", minPath, tempLinkList.size());
+	debugC(0, kDebugPathfinding, "MovGraph2::doWalkTo(): path: %g  parts: %d", minPath, tempLinkList.size());
 
 	if (minPath < 0.0 || ((linkInfoSource.node != linkInfoDest.node || !linkInfoSource.node) && !tempLinkList.size()))
 		return 0;
@@ -2800,22 +2800,22 @@ MovGraphLink::~MovGraphLink() {
 
 
 bool MovGraphLink::load(MfcArchive &file) {
-	debug(5, "MovGraphLink::load()");
+	debugC(5, kDebugLoading, "MovGraphLink::load()");
 
 	_dwordArray1.load(file);
 	_dwordArray2.load(file);
 
 	_flags = file.readUint32LE();
 
-	debug(8, "GraphNode1");
+	debugC(8, kDebugLoading, "GraphNode1");
 	_graphSrc = (MovGraphNode *)file.readClass();
-	debug(8, "GraphNode2");
+	debugC(8, kDebugLoading, "GraphNode2");
 	_graphDst = (MovGraphNode *)file.readClass();
 
 	_length = file.readDouble();
 	_angle = file.readDouble();
 
-	debug(8, "length: %g, angle: %g", _length, _angle);
+	debugC(8, kDebugLoading, "length: %g, angle: %g", _length, _angle);
 
 	_movGraphReact = (MovGraphReact *)file.readClass();
 	_name = file.readPascalString();
@@ -2834,7 +2834,7 @@ void MovGraphLink::recalcLength() {
 }
 
 bool MovGraphNode::load(MfcArchive &file) {
-	debug(5, "MovGraphNode::load()");
+	debugC(5, kDebugLoading, "MovGraphNode::load()");
 
 	_field_14 = file.readUint32LE();
 	_x = file.readUint32LE();
@@ -2854,7 +2854,7 @@ ReactParallel::ReactParallel() {
 }
 
 bool ReactParallel::load(MfcArchive &file) {
-	debug(5, "ReactParallel::load()");
+	debugC(5, kDebugLoading, "ReactParallel::load()");
 
 	_x1 = file.readUint32LE();
 	_y1 = file.readUint32LE();
@@ -2912,7 +2912,7 @@ ReactPolygonal::~ReactPolygonal() {
 }
 
 bool ReactPolygonal::load(MfcArchive &file) {
-	debug(5, "ReactPolygonal::load()");
+	debugC(5, kDebugLoading, "ReactPolygonal::load()");
 
 	_centerX = file.readUint32LE();
 	_centerY = file.readUint32LE();
diff --git a/engines/fullpipe/scene.cpp b/engines/fullpipe/scene.cpp
index 067fbff..b47988d 100644
--- a/engines/fullpipe/scene.cpp
+++ b/engines/fullpipe/scene.cpp
@@ -55,7 +55,7 @@ Scene *FullpipeEngine::accessScene(int sceneId) {
 }
 
 bool SceneTagList::load(MfcArchive &file) {
-	debug(5, "SceneTagList::load()");
+	debugC(5, kDebugLoading, "SceneTagList::load()");
 
 	int numEntries = file.readUint16LE();
 
@@ -76,7 +76,7 @@ SceneTag::SceneTag() {
 }
 
 bool SceneTag::load(MfcArchive &file) {
-	debug(5, "SceneTag::load()");
+	debugC(5, kDebugLoading, "SceneTag::load()");
 
 	_field_4 = 0;
 	_scene = 0;
@@ -85,7 +85,7 @@ bool SceneTag::load(MfcArchive &file) {
 
 	_tag = file.readPascalString();
 
-	debug(6, "sceneId: %d  tag: %s", _sceneId, _tag);
+	debugC(6, kDebugLoading, "sceneId: %d  tag: %s", _sceneId, _tag);
 
 	return true;
 }
@@ -157,7 +157,7 @@ Scene::~Scene() {
 }
 
 bool Scene::load(MfcArchive &file) {
-	debug(5, "Scene::load()");
+	debugC(5, kDebugLoading, "Scene::load()");
 
 	Background::load(file);
 
@@ -167,7 +167,7 @@ bool Scene::load(MfcArchive &file) {
 	debug(0, "scene: <%s> %d", transCyrillic((byte *)_sceneName), _sceneId);
 
 	int count = file.readUint16LE();
-	debug(7, "scene.ani: %d", count);
+	debugC(7, kDebugLoading, "scene.ani: %d", count);
 
 	for (int i = 0; i < count; i++) {
 		int aniNum = file.readUint16LE();
@@ -189,7 +189,7 @@ bool Scene::load(MfcArchive &file) {
 	}
 
 	count = file.readUint16LE();
-	debug(7, "scene.mq: %d", count);
+	debugC(7, kDebugLoading, "scene.mq: %d", count);
 
 	for (int i = 0; i < count; i++) {
 		int qNum = file.readUint16LE();
@@ -211,7 +211,7 @@ bool Scene::load(MfcArchive &file) {
 	}
 
 	count = file.readUint16LE();
-	debug(7, "scene.fa: %d", count);
+	debugC(7, kDebugLoading, "scene.fa: %d", count);
 
 	for (int i = 0; i < count; i++) {
 		// There are no .FA files
@@ -497,7 +497,7 @@ void Scene::objectList_sortByPriority(Common::Array<PictureObject *> &list, bool
 }
 
 void Scene::draw() {
-	debug(6, ">>>>> Scene::draw()");
+	debugC(6, kDebugDrawing, ">>>>> Scene::draw()");
 	updateScrolling();
 
 	// Clean previous stuff
@@ -640,7 +640,7 @@ int Scene::getPictureObjectIdAtPos(int x, int y) {
 }
 
 void Scene::update(int counterdiff) {
-	debug(6, "Scene::update(%d)", counterdiff);
+	debugC(6, kDebugDrawing, "Scene::update(%d)", counterdiff);
 
 	for (uint i = 0; i < _staticANIObjectList2.size(); i++)
 		_staticANIObjectList2[i]->update(counterdiff);
@@ -679,11 +679,11 @@ void Scene::drawContent(int minPri, int maxPri, bool drawBg) {
 		int width = point.x;
 		int height = point.y;
 
-		debug(8, "w: %d h:%d", width, height);
+		debugC(8, kDebugDrawing, "w: %d h:%d", width, height);
 
 		((PictureObject *)_picObjList[0])->getDimensions(&point);
 
-		debug(8, "w2: %d h2:%d", point.x, point.y);
+		debugC(8, kDebugDrawing, "w2: %d h2:%d", point.x, point.y);
 
 		int bgStX = g_fp->_sceneRect.left % point.x;
 
@@ -744,7 +744,7 @@ void Scene::drawContent(int minPri, int maxPri, bool drawBg) {
 		int objX = obj->_ox;
 		int objY = obj->_oy;
 
-		debug(8, "obj: %d %d", objX, objY);
+		debugC(8, kDebugDrawing, "obj: %d %d", objX, objY);
 
 		obj->getDimensions(&point);
 
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index 059fd82..d4045b1 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -201,7 +201,7 @@ StaticANIObject::StaticANIObject(StaticANIObject *src) : GameObject(src) {
 }
 
 bool StaticANIObject::load(MfcArchive &file) {
-	debug(5, "StaticANIObject::load()");
+	debugC(5, kDebugLoading, "StaticANIObject::load()");
 
 	GameObject::load(file);
 
@@ -215,7 +215,7 @@ bool StaticANIObject::load(MfcArchive &file) {
 	}
 
 	count = file.readUint16LE();
-	debug(7, "Movements: %d", count);
+	debugC(7, kDebugLoading, "Movements: %d", count);
 
 	for (int i = 0; i < count; i++) {
 		int movNum = file.readUint16LE();
@@ -512,7 +512,7 @@ bool StaticANIObject::getPixelAtPos(int x, int y, int *pixel) {
 }
 
 void Movement::draw(bool flipFlag, int angle) {
-	debug(3, "Movement::draw(%d, %d)", flipFlag, angle);
+	debugC(3, kDebugDrawing, "Movement::draw(%d, %d)", flipFlag, angle);
 
 	Common::Point point;
 
@@ -594,7 +594,7 @@ void StaticANIObject::draw() {
 	Common::Point point;
 	Common::Rect rect;
 
-	debug(6, "StaticANIObject::draw() (%s) [%d] [%d, %d]", transCyrillic((byte *)_objectName), _id, _ox, _oy);
+	debugC(6, kDebugDrawing, "StaticANIObject::draw() (%s) [%d] [%d, %d]", transCyrillic((byte *)_objectName), _id, _ox, _oy);
 
 	if (_shadowsOn && g_fp->_currentScene && g_fp->_currentScene->_shadows
 		&& (getCurrDimensions(point)->x != 1 || getCurrDimensions(point)->y != 1)) {
@@ -654,7 +654,7 @@ void StaticANIObject::draw() {
 }
 
 void StaticANIObject::draw2() {
-	debug(6, "StatciANIObject::draw2(): id: (%s) %d [%d, %d]", transCyrillic((byte *)_objectName), _id, _ox, _oy);
+	debugC(6, kDebugDrawing, "StatciANIObject::draw2(): id: (%s) %d [%d, %d]", transCyrillic((byte *)_objectName), _id, _ox, _oy);
 
 	if ((_flags & 4) && (_flags & 0x10)) {
 		if (_movement) {
@@ -1444,14 +1444,14 @@ Statics::Statics(Statics *src, bool reverse) : DynamicPhase(src, reverse) {
 }
 
 bool Statics::load(MfcArchive &file) {
-	debug(5, "Statics::load()");
+	debugC(5, kDebugLoading, "Statics::load()");
 
 	DynamicPhase::load(file);
 
 	_staticsId = file.readUint16LE();
 
 	_staticsName = file.readPascalString();
-	debug(7, "statics: <%s> id: %d (%x)", transCyrillic((byte *)_staticsName), _staticsId, _staticsId);
+	debugC(7, kDebugLoading, "statics: <%s> id: %d (%x)", transCyrillic((byte *)_staticsName), _staticsId, _staticsId);
 
 	_picture = new Picture();
 	_picture->load(file);
@@ -1670,7 +1670,7 @@ bool Movement::load(MfcArchive &file, StaticANIObject *ani) {
 
 	int dynCount = file.readUint16LE();
 
-	debug(7, "dynCount: %d  _id: %d", dynCount, _id);
+	debugC(7, kDebugLoading, "dynCount: %d  _id: %d", dynCount, _id);
 	if (dynCount != 0xffff || _id == MV_MAN_TURN_LU) {
 		_framePosOffsets = (Common::Point **)calloc(dynCount + 2, sizeof(Common::Point *));
 
@@ -2254,7 +2254,7 @@ DynamicPhase::DynamicPhase(DynamicPhase *src, bool reverse) {
 }
 
 bool DynamicPhase::load(MfcArchive &file) {
-	debug(5, "DynamicPhase::load()");
+	debugC(5, kDebugLoading, "DynamicPhase::load()");
 
 	StaticPhase::load(file);
 
@@ -2290,7 +2290,7 @@ StaticPhase::~StaticPhase() {
 }
 
 bool StaticPhase::load(MfcArchive &file) {
-	debug(5, "StaticPhase::load()");
+	debugC(5, kDebugLoading, "StaticPhase::load()");
 
 	Picture::load(file);
 


Commit: 6ac435099c0ccdeb55fc0e5c195b92d68ed9344e
    https://github.com/scummvm/scummvm/commit/6ac435099c0ccdeb55fc0e5c195b92d68ed9344e
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-07-28T00:37:32+03:00

Commit Message:
FULLPIPE: Split all debug output by channels

Changed paths:
    engines/fullpipe/behavior.cpp
    engines/fullpipe/fullpipe.cpp
    engines/fullpipe/fullpipe.h
    engines/fullpipe/gameloader.cpp
    engines/fullpipe/gfx.cpp
    engines/fullpipe/interaction.cpp
    engines/fullpipe/inventory.cpp
    engines/fullpipe/messagehandlers.cpp
    engines/fullpipe/messages.cpp
    engines/fullpipe/motion.cpp
    engines/fullpipe/ngiarchive.cpp
    engines/fullpipe/sound.cpp
    engines/fullpipe/stateloader.cpp
    engines/fullpipe/statics.cpp
    engines/fullpipe/utils.cpp



diff --git a/engines/fullpipe/behavior.cpp b/engines/fullpipe/behavior.cpp
index c90b2b0..75b1c78 100644
--- a/engines/fullpipe/behavior.cpp
+++ b/engines/fullpipe/behavior.cpp
@@ -83,7 +83,7 @@ void BehaviorManager::updateBehaviors() {
 	if (!_isActive)
 		return;
 
-	debug(4, "BehaviorManager::updateBehaviors()");
+	debugC(4, kDebugAnimation, "BehaviorManager::updateBehaviors()");
 	for (uint i = 0; i < _behaviors.size(); i++) {
 		BehaviorInfo *beh = _behaviors[i];
 
@@ -122,7 +122,7 @@ void BehaviorManager::updateBehaviors() {
 }
 
 void BehaviorManager::updateBehavior(BehaviorInfo *behaviorInfo, BehaviorAnim *entry) {
-	debug(4, "BehaviorManager::updateBehavior() %d", entry->_movesCount);
+	debugC(4, kDebugAnimation, "BehaviorManager::updateBehavior() %d", entry->_movesCount);
 	for (int i = 0; i < entry->_movesCount; i++) {
 		BehaviorMove *bhi = entry->_behaviorMoves[i];
 		if (!(bhi->_flags & 1)) {
@@ -144,7 +144,7 @@ void BehaviorManager::updateBehavior(BehaviorInfo *behaviorInfo, BehaviorAnim *e
 }
 
 void BehaviorManager::updateStaticAniBehavior(StaticANIObject *ani, int delay, BehaviorAnim *bhe) {
-	debug(4, "BehaviorManager::updateStaticAniBehavior(%s)", transCyrillic((byte *)ani->_objectName));
+	debugC(4, kDebugAnimation, "BehaviorManager::updateStaticAniBehavior(%s)", transCyrillic((byte *)ani->_objectName));
 
 	MessageQueue *mq = 0;
 
@@ -236,7 +236,7 @@ void BehaviorInfo::clear() {
 }
 
 void BehaviorInfo::initAmbientBehavior(GameVar *var, Scene *sc) {
-	debug(4, "BehaviorInfo::initAmbientBehavior(%s)", transCyrillic((byte *)var->_varName));
+	debugC(4, kDebugAnimation, "BehaviorInfo::initAmbientBehavior(%s)", transCyrillic((byte *)var->_varName));
 
 	clear();
 	_animsCount = 1;
@@ -260,7 +260,7 @@ void BehaviorInfo::initAmbientBehavior(GameVar *var, Scene *sc) {
 }
 
 void BehaviorInfo::initObjectBehavior(GameVar *var, Scene *sc, StaticANIObject *ani) {
-	debug(4, "BehaviorInfo::initObjectBehavior(%s)", transCyrillic((byte *)var->_varName));
+	debugC(4, kDebugAnimation, "BehaviorInfo::initObjectBehavior(%s)", transCyrillic((byte *)var->_varName));
 
 	clear();
 
diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp
index fcfe78a..283c71e 100644
--- a/engines/fullpipe/fullpipe.cpp
+++ b/engines/fullpipe/fullpipe.cpp
@@ -203,6 +203,9 @@ void FullpipeEngine::initialize() {
 	DebugMan.addDebugChannel(kDebugPathfinding, "path", "Pathfinding");
 	DebugMan.addDebugChannel(kDebugDrawing, "drawing", "Drawing");
 	DebugMan.addDebugChannel(kDebugLoading, "loading", "Scene loading");
+	DebugMan.addDebugChannel(kDebugAnimation, "animation", "Animation");
+	DebugMan.addDebugChannel(kDebugMemory, "memory", "Memory management");
+	DebugMan.addDebugChannel(kDebugEvents, "events", "Event handling");
 
 	_globalMessageQueueList = new GlobalMessageQueueList;
 	_behaviorManager = new BehaviorManager;
@@ -457,7 +460,7 @@ void FullpipeEngine::cleanup() {
 }
 
 void FullpipeEngine::updateScreen() {
-	debug(4, "FullpipeEngine::updateScreen()");
+	debugC(4, kDebugDrawing, "FullpipeEngine::updateScreen()");
 
 	_mouseVirtX = _mouseScreenPos.x + _sceneRect.left;
 	_mouseVirtY = _mouseScreenPos.y + _sceneRect.top;
diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h
index ccbbf60..1c85536 100644
--- a/engines/fullpipe/fullpipe.h
+++ b/engines/fullpipe/fullpipe.h
@@ -51,7 +51,10 @@ enum FullpipeGameFeatures {
 enum AccessDebugChannels {
 	kDebugPathfinding = 1 << 0,
 	kDebugDrawing     = 1 << 1,
-	kDebugLoading     = 1 << 2
+	kDebugLoading     = 1 << 2,
+	kDebugAnimation   = 1 << 3,
+	kDebugMemory      = 1 << 4,
+	kDebugEvents      = 1 << 5
 };
 
 class BehaviorManager;
diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp
index 3a0e262..1cd5103 100644
--- a/engines/fullpipe/gameloader.cpp
+++ b/engines/fullpipe/gameloader.cpp
@@ -110,10 +110,10 @@ GameLoader::~GameLoader() {
 }
 
 bool GameLoader::load(MfcArchive &file) {
-	debug(1, "GameLoader::load()");
+	debugC(1, kDebugLoading, "GameLoader::load()");
 
 	_gameName = file.readPascalString();
-	debug(1, "_gameName: %s", _gameName);
+	debugC(1, kDebugLoading, "_gameName: %s", _gameName);
 
 	_gameProject = new GameProject();
 
@@ -126,13 +126,13 @@ bool GameLoader::load(MfcArchive &file) {
 	}
 
 	_gameName = file.readPascalString();
-	debug(1, "_gameName: %s", _gameName);
+	debugC(1, kDebugLoading, "_gameName: %s", _gameName);
 
 	_inventory.load(file);
 
 	_interactionController->load(file);
 
-	debug(1, "sceneTag count: %d", _gameProject->_sceneTagList->size());
+	debugC(1, kDebugLoading, "sceneTag count: %d", _gameProject->_sceneTagList->size());
 
 	_sc2array.resize(_gameProject->_sceneTagList->size());
 
@@ -142,7 +142,7 @@ bool GameLoader::load(MfcArchive &file) {
 
 		snprintf(tmp, 11, "%04d.sc2", it->_sceneId);
 
-		debug(1, "sc: %s", tmp);
+		debugC(1, kDebugLoading, "sc: %s", tmp);
 
 		_sc2array[i].loadFile((const char *)tmp);
 	}
@@ -152,7 +152,7 @@ bool GameLoader::load(MfcArchive &file) {
 	_field_FA = file.readUint16LE();
 	_field_F8 = file.readUint16LE();
 
-	debug(1, "_field_FA: %d\n_field_F8: %d", _field_FA, _field_F8);
+	debugC(1, kDebugLoading, "_field_FA: %d\n_field_F8: %d", _field_FA, _field_F8);
 
 	_gameVar = (GameVar *)file.readClass();
 
@@ -357,7 +357,7 @@ bool preloadCallback(PreloadItem &pre, int flag) {
 }
 
 bool GameLoader::preloadScene(int sceneId, int entranceId) {
-	debug(0, "preloadScene(%d, %d), ", sceneId, entranceId);
+	debugC(0, kDebugLoading, "preloadScene(%d, %d), ", sceneId, entranceId);
 
 	if (_preloadSceneId != sceneId || _preloadEntranceId != entranceId) {
 		_preloadSceneId = sceneId;
@@ -455,13 +455,13 @@ void GameLoader::applyPicAniInfos(Scene *sc, PicAniInfo **picAniInfo, int picAni
 	if (picAniInfoCount <= 0)
 		return;
 
-	debug(0, "GameLoader::applyPicAniInfos(sc, ptr, %d)", picAniInfoCount);
+	debugC(0, kDebugAnimation, "GameLoader::applyPicAniInfos(sc, ptr, %d)", picAniInfoCount);
 
 	PictureObject *pict;
 	StaticANIObject *ani;
 
 	for (int i = 0; i < picAniInfoCount; i++) {
-		debug(7, "PicAniInfo: id: %d type: %d", picAniInfo[i]->objectId, picAniInfo[i]->type);
+		debugC(7, kDebugAnimation, "PicAniInfo: id: %d type: %d", picAniInfo[i]->objectId, picAniInfo[i]->type);
 		if (picAniInfo[i]->type & 2) {
 			pict = sc->getPictureObjectById(picAniInfo[i]->objectId, picAniInfo[i]->field_8);
 			if (pict) {
@@ -551,14 +551,14 @@ Sc2::Sc2() {
 }
 
 bool Sc2::load(MfcArchive &file) {
-	debug(5, "Sc2::load()");
+	debugC(5, kDebugLoading, "Sc2::load()");
 
 	_sceneId = file.readUint16LE();
 
 	_motionController = (MotionController *)file.readClass();
 
 	_count1 = file.readUint32LE();
-	debug(4, "count1: %d", _count1);
+	debugC(4, kDebugLoading, "count1: %d", _count1);
 	if (_count1 > 0) {
 		_data1 = (int32 *)malloc(_count1 * sizeof(int32));
 
@@ -570,7 +570,7 @@ bool Sc2::load(MfcArchive &file) {
 	}
 
 	_defPicAniInfosCount = file.readUint32LE();
-	debug(4, "defPicAniInfos: %d", _defPicAniInfosCount);
+	debugC(4, kDebugLoading, "defPicAniInfos: %d", _defPicAniInfosCount);
 	if (_defPicAniInfosCount > 0) {
 		_defPicAniInfos = (PicAniInfo **)malloc(_defPicAniInfosCount * sizeof(PicAniInfo *));
 
@@ -587,7 +587,7 @@ bool Sc2::load(MfcArchive &file) {
 	_picAniInfosCount = 0;
 
 	_entranceDataCount = file.readUint32LE();
-	debug(4, "_entranceData: %d", _entranceDataCount);
+	debugC(4, kDebugLoading, "_entranceData: %d", _entranceDataCount);
 
 	if (_entranceDataCount > 0) {
 		_entranceData = (EntranceInfo **)malloc(_entranceDataCount * sizeof(EntranceInfo *));
@@ -607,7 +607,7 @@ bool Sc2::load(MfcArchive &file) {
 }
 
 bool PreloadItems::load(MfcArchive &file) {
-	debug(5, "PreloadItems::load()");
+	debugC(5, kDebugLoading, "PreloadItems::load()");
 
 	int count = file.readCount();
 
diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp
index 4284685..dcd5c33 100644
--- a/engines/fullpipe/gfx.cpp
+++ b/engines/fullpipe/gfx.cpp
@@ -58,7 +58,7 @@ Background::~Background() {
 }
 
 bool Background::load(MfcArchive &file) {
-	debug(5, "Background::load()");
+	debugC(5, kDebugLoading, "Background::load()");
 	_bgname = file.readPascalString();
 
 	int count = file.readUint16LE();
@@ -80,7 +80,7 @@ bool Background::load(MfcArchive &file) {
 
 	_bigPictureArray = (BigPicture ***)calloc(_bigPictureArray1Count, sizeof(BigPicture **));
 
-	debug(6, "bigPictureArray[%d][%d]", _bigPictureArray1Count, _bigPictureArray2Count);
+	debugC(6, kDebugLoading, "bigPictureArray[%d][%d]", _bigPictureArray1Count, _bigPictureArray2Count);
 
 	for (int i = 0; i < _bigPictureArray1Count; i++) {
 		_bigPictureArray[i] = (BigPicture **)calloc(_bigPictureArray2Count, sizeof(BigPicture *));
@@ -137,7 +137,7 @@ PictureObject::PictureObject(PictureObject *src) : GameObject(src) {
 }
 
 bool PictureObject::load(MfcArchive &file, bool bigPicture) {
-	debug(5, "PictureObject::load()");
+	debugC(5, kDebugLoading, "PictureObject::load()");
 	GameObject::load(file);
 
 	if (bigPicture)
@@ -282,7 +282,7 @@ GameObject::~GameObject() {
 }
 
 bool GameObject::load(MfcArchive &file) {
-	debug(5, "GameObject::load()");
+	debugC(5, kDebugLoading, "GameObject::load()");
 	_okeyCode = 0;
 	_flags = 0;
 	_field_20 = 0;
@@ -464,7 +464,7 @@ Picture::~Picture() {
 }
 
 void Picture::freePicture() {
-	debug(5, "Picture::freePicture(): file: %s", _memfilename);
+	debugC(5, kDebugMemory, "Picture::freePicture(): file: %s", _memfilename);
 
 	if (_bitmap) {
 		if (testFlags() && !_field_54) {
@@ -492,7 +492,7 @@ void Picture::freePixelData() {
 }
 
 bool Picture::load(MfcArchive &file) {
-	debug(5, "Picture::load()");
+	debugC(5, kDebugLoading, "Picture::load()");
 	MemoryObject::load(file);
 
 	_x = file.readUint32LE();
@@ -526,7 +526,7 @@ bool Picture::load(MfcArchive &file) {
 
 	getData();
 
-	debug(5, "Picture::load: loaded <%s>", _memfilename);
+	debugC(5, kDebugLoading, "Picture::load: loaded <%s>", _memfilename);
 
 	return true;
 }
@@ -546,7 +546,7 @@ void Picture::setAOIDs() {
 }
 
 void Picture::init() {
-	debug(5, "Picture::init(), %s", _memfilename);
+	debugC(5, kDebugLoading, "Picture::init(), %s", _memfilename);
 
 	MemoryObject::getData();
 
@@ -567,7 +567,7 @@ Common::Point *Picture::getDimensions(Common::Point *p) {
 void Picture::getDibInfo() {
 	int off = _dataSize & ~0xf;
 
-	debug(9, "Picture::getDibInfo: _dataSize: %d", _dataSize);
+	debugC(9, kDebugLoading, "Picture::getDibInfo: _dataSize: %d", _dataSize);
 
 	if (!_dataSize) {
 		warning("Picture::getDibInfo(): Empty data size");
@@ -605,7 +605,7 @@ void Picture::draw(int x, int y, int style, int angle) {
 	int x1 = x;
 	int y1 = y;
 
-	debug(7, "Picture::draw(%d, %d, %d, %d) (%s)", x, y, style, angle, _memfilename);
+	debugC(7, kDebugDrawing, "Picture::draw(%d, %d, %d, %d) (%s)", x, y, style, angle, _memfilename);
 
 	if (x != -1)
 		x1 = x;
@@ -620,7 +620,7 @@ void Picture::draw(int x, int y, int style, int angle) {
 		return;
 
 	if ((_alpha & 0xff) < 0xff) {
-		debug(7, "Picture:draw: alpha = %0x", _alpha);
+		debugC(7, kDebugDrawing, "Picture:draw: alpha = %0x", _alpha);
 	}
 
 	byte *pal = _paletteData;
@@ -784,7 +784,7 @@ Bitmap::~Bitmap() {
 }
 
 void Bitmap::load(Common::ReadStream *s) {
-	debug(5, "Bitmap::load()");
+	debugC(5, kDebugLoading, "Bitmap::load()");
 
 	_x = s->readUint32LE();
 	_y = s->readUint32LE();
@@ -795,8 +795,8 @@ void Bitmap::load(Common::ReadStream *s) {
 	_dataSize = s->readUint32LE();
 	_flags = s->readUint32LE();
 
-	debug(8, "Bitmap: x: %d y: %d w: %d h: %d dataSize: 0x%x", _x, _y, _width, _height, _dataSize);
-	debug(8, "Bitmap: type: %s (0x%04x) flags: 0x%x", Common::tag2string(_type).c_str(), _type, _flags);
+	debugC(8, kDebugLoading, "Bitmap: x: %d y: %d w: %d h: %d dataSize: 0x%x", _x, _y, _width, _height, _dataSize);
+	debugC(8, kDebugLoading, "Bitmap: type: %s (0x%04x) flags: 0x%x", Common::tag2string(_type).c_str(), _type, _flags);
 }
 
 bool Bitmap::isPixelHitAtPos(int x, int y) {
@@ -821,7 +821,7 @@ void Bitmap::decode(int32 *palette) {
 }
 
 void Bitmap::putDib(int x, int y, int32 *palette, int alpha) {
-	debug(7, "Bitmap::putDib(%d, %d)", x, y);
+	debugC(7, kDebugDrawing, "Bitmap::putDib(%d, %d)", x, y);
 
 	int x1 = x - g_fp->_sceneRect.left;
 	int y1 = y - g_fp->_sceneRect.top;
@@ -868,11 +868,11 @@ bool Bitmap::putDibRB(int32 *palette) {
 	uint16 *srcPtr;
 
 	if (!palette) {
-		debug(2, "Bitmap::putDibRB(): Both global and local palettes are empty");
+		debugC(2, kDebugDrawing, "Bitmap::putDibRB(): Both global and local palettes are empty");
 		return false;
 	}
 
-	debug(8, "Bitmap::putDibRB()");
+	debugC(8, kDebugDrawing, "Bitmap::putDibRB()");
 
 	endy = _height - 1;
 
@@ -1149,7 +1149,7 @@ void Bitmap::drawRotated(int x, int y, int angle, byte *palette, int alpha) {
 }
 
 bool BigPicture::load(MfcArchive &file) {
-	debug(5, "BigPicture::load()");
+	debugC(5, kDebugLoading, "BigPicture::load()");
 	Picture::load(file);
 
 	return true;
@@ -1190,7 +1190,7 @@ Shadows::Shadows() {
 }
 
 bool Shadows::load(MfcArchive &file) {
-	debug(5, "Shadows::load()");
+	debugC(5, kDebugLoading, "Shadows::load()");
 	_sceneId = file.readUint32LE();
 	_staticAniObjectId = file.readUint32LE();
 	_movementId = file.readUint32LE();
diff --git a/engines/fullpipe/interaction.cpp b/engines/fullpipe/interaction.cpp
index 4aac348..79c714c 100644
--- a/engines/fullpipe/interaction.cpp
+++ b/engines/fullpipe/interaction.cpp
@@ -62,7 +62,7 @@ InteractionController::~InteractionController() {
 }
 
 bool InteractionController::load(MfcArchive &file) {
-	debug(5, "InteractionController::load()");
+	debugC(5, kDebugLoading, "InteractionController::load()");
 
 	return _interactions.load(file);
 }
@@ -440,7 +440,7 @@ Interaction::~Interaction() {
 }
 
 bool Interaction::load(MfcArchive &file) {
-	debug(5, "Interaction::load()");
+	debugC(5, kDebugLoading, "Interaction::load()");
 
 	_objectId1 = file.readUint16LE();
 	_objectId2 = file.readUint16LE();
@@ -531,7 +531,7 @@ bool Interaction::isOverlapping(StaticANIObject *subj, GameObject *obj) {
 }
 
 bool EntranceInfo::load(MfcArchive &file) {
-	debug(5, "EntranceInfo::load()");
+	debugC(5, kDebugLoading, "EntranceInfo::load()");
 
 	_sceneId = file.readUint32LE();
 	_field_4 = file.readUint32LE();
diff --git a/engines/fullpipe/inventory.cpp b/engines/fullpipe/inventory.cpp
index f9b507c..aa229d5 100644
--- a/engines/fullpipe/inventory.cpp
+++ b/engines/fullpipe/inventory.cpp
@@ -35,7 +35,7 @@ Inventory::~Inventory() {
 }
 
 bool Inventory::load(MfcArchive &file) {
-	debug(5, "Inventory::load()");
+	debugC(5, kDebugLoading, "Inventory::load()");
 
 	_sceneId = file.readUint16LE();
 	int numInvs = file.readUint32LE();
diff --git a/engines/fullpipe/messagehandlers.cpp b/engines/fullpipe/messagehandlers.cpp
index b9c7996..903db15 100644
--- a/engines/fullpipe/messagehandlers.cpp
+++ b/engines/fullpipe/messagehandlers.cpp
@@ -100,7 +100,7 @@ void global_messageHandler_KickMetal() {
 }
 
 int global_messageHandler1(ExCommand *cmd) {
-	debug(5, "global_messageHandler1: %d %d", cmd->_messageKind, cmd->_messageNum);
+	debugC(5, kDebugEvents, "global_messageHandler1: %d %d", cmd->_messageKind, cmd->_messageNum);
 
 	if (cmd->_excFlags & 0x10000) {
 		if (cmd->_messageNum == MV_MAN_TOLADDER)
@@ -364,7 +364,7 @@ int global_messageHandler3(ExCommand *cmd) {
 	case 17:
 		switch (cmd->_messageNum) {
 		case 61:
-			debug(0, "preload: { %d, %d },", cmd->_parentId, cmd->_keyCode);
+			debugC(0, kDebugEvents, "preload: { %d, %d },", cmd->_parentId, cmd->_keyCode);
 			return g_fp->_gameLoader->preloadScene(cmd->_parentId, cmd->_keyCode);
 		case 62:
 			return g_fp->_gameLoader->gotoScene(cmd->_parentId, cmd->_keyCode);
diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp
index a7337b9..8652223e 100644
--- a/engines/fullpipe/messages.cpp
+++ b/engines/fullpipe/messages.cpp
@@ -57,7 +57,7 @@ ExCommand::ExCommand(int16 parentId, int messageKind, int messageNum, int x, int
 }
 
 bool ExCommand::load(MfcArchive &file) {
-	debug(5, "ExCommand::load()");
+	debugC(5, kDebugLoading, "ExCommand::load()");
 
 	_parentId = file.readUint16LE();
 	_messageKind = file.readUint32LE();
@@ -247,7 +247,7 @@ ObjstateCommand::~ObjstateCommand() {
 }
 
 bool ObjstateCommand::load(MfcArchive &file) {
-	debug(5, "ObjStateCommand::load()");
+	debugC(5, kDebugLoading, "ObjStateCommand::load()");
 
 	_objtype = kObjTypeObjstateCommand;
 
@@ -341,7 +341,7 @@ MessageQueue::~MessageQueue() {
 }
 
 bool MessageQueue::load(MfcArchive &file) {
-	debug(5, "MessageQueue::load()");
+	debugC(5, kDebugLoading, "MessageQueue::load()");
 
 	_dataId = file.readUint16LE();
 
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index 2829bdc..ad6bef2 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -2094,7 +2094,7 @@ MessageQueue *MovGraph2::doWalkTo(StaticANIObject *obj, int xpos, int ypos, int
 	PicAniInfo picAniInfo;
 	Common::Point point;
 
-	debugC(0, kDebugPathfinding, "MovGraph2::doWalkTo(%d, %d, %d, %d, %d)", obj->_id, xpos, ypos, fuzzyMatch, staticsId);
+	debugC(1, kDebugPathfinding, "MovGraph2::doWalkTo(%d, %d, %d, %d, %d)", obj->_id, xpos, ypos, fuzzyMatch, staticsId);
 
 	int idx = getItemIndexByGameObjectId(obj->_id);
 
@@ -2227,7 +2227,7 @@ MessageQueue *MovGraph2::doWalkTo(StaticANIObject *obj, int xpos, int ypos, int
 	Common::Array<MovGraphLink *> tempLinkList;
 	double minPath = findMinPath(&linkInfoSource, &linkInfoDest, &tempLinkList);
 
-	debugC(0, kDebugPathfinding, "MovGraph2::doWalkTo(): path: %g  parts: %d", minPath, tempLinkList.size());
+	debugC(1, kDebugPathfinding, "MovGraph2::doWalkTo(): path: %g  parts: %d", minPath, tempLinkList.size());
 
 	if (minPath < 0.0 || ((linkInfoSource.node != linkInfoDest.node || !linkInfoSource.node) && !tempLinkList.size()))
 		return 0;
diff --git a/engines/fullpipe/ngiarchive.cpp b/engines/fullpipe/ngiarchive.cpp
index 132f475..7d75dc2e7 100644
--- a/engines/fullpipe/ngiarchive.cpp
+++ b/engines/fullpipe/ngiarchive.cpp
@@ -93,11 +93,11 @@ NGIArchive::NGIArchive(const Common::String &filename) : _ngiFilename(filename)
 
 	g_fp->_currArchive = this;
 
-	debug(0, "NGIArchive::NGIArchive(%s): Located %d files", filename.c_str(), _headers.size());
+	debugC(0, kDebugLoading, "NGIArchive::NGIArchive(%s): Located %d files", filename.c_str(), _headers.size());
 }
 
 NGIArchive::~NGIArchive() {
-	debug(0, "NGIArchive Destructor Called");
+	debugC(0, kDebugLoading, "NGIArchive Destructor Called");
 	NgiHeadersMap::iterator it = _headers.begin();
 	for ( ; it != _headers.end(); ++it) {
 		delete it->_value;
diff --git a/engines/fullpipe/sound.cpp b/engines/fullpipe/sound.cpp
index c82c2c4..6bf85e7 100644
--- a/engines/fullpipe/sound.cpp
+++ b/engines/fullpipe/sound.cpp
@@ -44,7 +44,7 @@ SoundList::SoundList() {
 }
 
 bool SoundList::load(MfcArchive &file, char *fname) {
-	debug(5, "SoundList::load()");
+	debugC(5, kDebugLoading, "SoundList::load()");
 
 	_soundItemsCount = file.readUint32LE();
 	_soundItems = (Sound **)calloc(_soundItemsCount, sizeof(Sound *));
@@ -107,7 +107,7 @@ Sound::~Sound() {
 }
 
 bool Sound::load(MfcArchive &file, NGIArchive *archive) {
-	debug(5, "Sound::load()");
+	debugC(5, kDebugLoading, "Sound::load()");
 
 	MemoryObject::load(file);
 
diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp
index 141196c..c95f6c6 100644
--- a/engines/fullpipe/stateloader.cpp
+++ b/engines/fullpipe/stateloader.cpp
@@ -112,7 +112,7 @@ GameProject::GameProject() {
 }
 
 bool GameProject::load(MfcArchive &file) {
-	debug(5, "GameProject::load()");
+	debugC(5, kDebugLoading, "GameProject::load()");
 
 	_field_4 = 0;
 	_headerFilename = 0;
@@ -124,10 +124,10 @@ bool GameProject::load(MfcArchive &file) {
 
 	_headerFilename = file.readPascalString();
 
-	debug(1, "_gameProjectVersion = %d", g_fp->_gameProjectVersion);
-	debug(1, "_pictureScale = %d", g_fp->_pictureScale);
-	debug(1, "_scrollSpeed = %d", g_fp->_scrollSpeed);
-	debug(1, "_headerFilename = %s", _headerFilename);
+	debugC(1, kDebugLoading, "_gameProjectVersion = %d", g_fp->_gameProjectVersion);
+	debugC(1, kDebugLoading, "_pictureScale = %d", g_fp->_pictureScale);
+	debugC(1, kDebugLoading, "_scrollSpeed = %d", g_fp->_scrollSpeed);
+	debugC(1, kDebugLoading, "_headerFilename = %s", _headerFilename);
 
 	_sceneTagList = new SceneTagList();
 
@@ -205,24 +205,24 @@ bool GameVar::load(MfcArchive &file) {
 	_varName = file.readPascalString();
 	_varType = file.readUint32LE();
 
-	debugN(6, "[%03d] ", file.getLevel());
+	debugCN(6, kDebugLoading, "[%03d] ", file.getLevel());
 	for (int i = 0; i < file.getLevel(); i++)
-		debugN(6, " ");
+		debugCN(6, kDebugLoading, " ");
 
-	debugN(6, "<%s>: ", transCyrillic((byte *)_varName));
+	debugCN(6, kDebugLoading, "<%s>: ", transCyrillic((byte *)_varName));
 
 	switch (_varType) {
 	case 0:
 		_value.intValue = file.readUint32LE();
-		debug(6, "d --> %d", _value.intValue);
+		debugC(6, kDebugLoading, "d --> %d", _value.intValue);
 		break;
 	case 1:
 		_value.intValue = file.readUint32LE(); // FIXME
-		debug(6, "f --> %f", _value.floatValue);
+		debugC(6, kDebugLoading, "f --> %f", _value.floatValue);
 		break;
 	case 2:
 		_value.stringValue = file.readPascalString();
-		debug(6, "s --> %s", _value.stringValue);
+		debugC(6, kDebugLoading, "s --> %s", _value.stringValue);
 		break;
 	default:
 		error("Unknown var type: %d (0x%x)", _varType, _varType);
@@ -342,7 +342,7 @@ GameVar *GameVar::getSubVarByIndex(int idx) {
 }
 
 bool PicAniInfo::load(MfcArchive &file) {
-	debug(5, "PicAniInfo::load()");
+	debugC(5, kDebugLoading, "PicAniInfo::load()");
 
 	type = file.readUint32LE();
 	objectId = file.readUint16LE();
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index d4045b1..14245d5 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -779,7 +779,7 @@ Common::Point *StaticANIObject::getSomeXY(Common::Point &p) {
 void StaticANIObject::update(int counterdiff) {
 	int mqid;
 
-	debug(6, "StaticANIObject::update() (%s) [%d] [%d, %d] fl: %x", transCyrillic((byte *)_objectName), _id, _ox, _oy, _flags);
+	debugC(6, kDebugAnimation, "StaticANIObject::update() (%s) [%d] [%d, %d] fl: %x", transCyrillic((byte *)_objectName), _id, _ox, _oy, _flags);
 
 	if (_flags & 2) {
 		_messageNum--;
@@ -951,7 +951,7 @@ Common::Point *StaticANIObject::calcNextStep(Common::Point *pRes) {
 }
 
 void StaticANIObject::stopAnim_maybe() {
-	debug(6, "StaticANIObject::stopAnim_maybe()");
+	debugC(6, kDebugAnimation, "StaticANIObject::stopAnim_maybe()");
 
 	if (!(_flags & 1))
 		return;
@@ -1093,7 +1093,7 @@ void StaticANIObject::hide() {
 }
 
 void StaticANIObject::show1(int x, int y, int movId, int mqId) {
-	debug(6, "StaticANIObject::show1(%d, %d, %d, %d)", x, y, movId, mqId);
+	debugC(6, kDebugAnimation, "StaticANIObject::show1(%d, %d, %d, %d)", x, y, movId, mqId);
 
 	if (_messageQueueId)
 		return;
@@ -1285,7 +1285,7 @@ bool StaticANIObject::startAnim(int movementId, int messageQueueId, int dynPhase
 	if (_flags & 0x80)
 		return false;
 
-	debug(4, "StaticANIObject::startAnim(%d, %d, %d) (%s [%d]) [%d, %d]", movementId, messageQueueId, dynPhaseIdx, transCyrillic((byte *)_objectName), _id, _ox, _oy);
+	debugC(4, kDebugAnimation, "StaticANIObject::startAnim(%d, %d, %d) (%s [%d]) [%d, %d]", movementId, messageQueueId, dynPhaseIdx, transCyrillic((byte *)_objectName), _id, _ox, _oy);
 
 	if (_messageQueueId) {
 		updateGlobalMessageQueue(messageQueueId, _id);
@@ -1826,7 +1826,7 @@ void Movement::initStatics(StaticANIObject *ani) {
 	if (!_currMovement)
 		return;
 
-	debug(7, "Movement::initStatics()");
+	debugC(7, kDebugAnimation, "Movement::initStatics()");
 
 	_staticsObj2 = ani->addReverseStatics(_currMovement->_staticsObj2);
 	_staticsObj1 = ani->addReverseStatics(_currMovement->_staticsObj1);
@@ -1853,7 +1853,7 @@ void Movement::initStatics(StaticANIObject *ani) {
 }
 
 void Movement::updateCurrDynamicPhase() {
-	debug(7, "Movement::updateCurrDynamicPhase()");
+	debugC(7, kDebugAnimation, "Movement::updateCurrDynamicPhase()");
 
 	if (_currMovement) {
 		if (_currMovement->_dynamicPhases.size() == 0 || (uint)_currDynamicPhaseIndex >= _currMovement->_dynamicPhases.size())
@@ -1905,7 +1905,7 @@ int Movement::countPhasesWithFlag(int maxidx, int flag) {
 }
 
 void Movement::setDynamicPhaseIndex(int index) {
-	debug(7, "Movement::setDynamicPhaseIndex(%d)", index);
+	debugC(7, kDebugAnimation, "Movement::setDynamicPhaseIndex(%d)", index);
 	while (_currDynamicPhaseIndex < index)
 		gotoNextFrame(0, 0);
 
@@ -1914,7 +1914,7 @@ void Movement::setDynamicPhaseIndex(int index) {
 }
 
 DynamicPhase *Movement::getDynamicPhaseByIndex(int idx) {
-	debug(7, "Movement::updateCurrDynamicPhase()");
+	debugC(7, kDebugAnimation, "Movement::updateCurrDynamicPhase()");
 
 	if (_currMovement) {
 		if (_currMovement->_dynamicPhases.size() == 0 || (uint)idx >= _currMovement->_dynamicPhases.size())
@@ -1973,7 +1973,7 @@ void Movement::removeFirstPhase() {
 }
 
 bool Movement::gotoNextFrame(void (*callback1)(int, Common::Point *point, int, int), void (*callback2)(int *)) {
-	debug(8, "Movement::gotoNextFrame()");
+	debugC(8, kDebugAnimation, "Movement::gotoNextFrame()");
 
 	if (!callback2) {
 		if (_currMovement) {
@@ -2094,7 +2094,7 @@ bool Movement::gotoNextFrame(void (*callback1)(int, Common::Point *point, int, i
 }
 
 bool Movement::gotoPrevFrame() {
-	debug(8, "Movement::gotoPrevFrame()");
+	debugC(8, kDebugAnimation, "Movement::gotoPrevFrame()");
 
 	if (!_currDynamicPhaseIndex) {
 		gotoLastFrame();
@@ -2192,7 +2192,7 @@ DynamicPhase::DynamicPhase(DynamicPhase *src, bool reverse) {
 	_field_7E = 0;
 	_rect = new Common::Rect();
 
-	debug(1, "DynamicPhase::DynamicPhase(src, %d)", reverse);
+	debugC(1, kDebugAnimation, "DynamicPhase::DynamicPhase(src, %d)", reverse);
 
 	if (reverse) {
 		if (!src->_bitmap)
diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp
index a7dee2e..a8e0046 100644
--- a/engines/fullpipe/utils.cpp
+++ b/engines/fullpipe/utils.cpp
@@ -45,13 +45,13 @@ bool CObject::loadFile(const char *fname) {
 }
 
 bool ObList::load(MfcArchive &file) {
-	debug(5, "ObList::load()");
+	debugC(5, kDebugLoading, "ObList::load()");
 	int count = file.readCount();
 
-	debug(9, "ObList::count: %d:", count);
+	debugC(9, kDebugLoading, "ObList::count: %d:", count);
 
 	for (int i = 0; i < count; i++) {
-		debug(9, "ObList::[%d]", i);
+		debugC(9, kDebugLoading, "ObList::[%d]", i);
 		CObject *t = file.readClass();
 
 		push_back(t);
@@ -61,7 +61,7 @@ bool ObList::load(MfcArchive &file) {
 }
 
 bool ObArray::load(MfcArchive &file) {
-	debug(5, "ObArray::load()");
+	debugC(5, kDebugLoading, "ObArray::load()");
 	int count = file.readCount();
 
 	resize(count);
@@ -76,10 +76,10 @@ bool ObArray::load(MfcArchive &file) {
 }
 
 bool DWordArray::load(MfcArchive &file) {
-	debug(5, "DWordArray::load()");
+	debugC(5, kDebugLoading, "DWordArray::load()");
 	int count = file.readCount();
 
-	debug(9, "DWordArray::count: %d", count);
+	debugC(9, kDebugLoading, "DWordArray::count: %d", count);
 
 	resize(count);
 
@@ -104,7 +104,7 @@ char *MfcArchive::readPascalString(bool twoByte) {
 	tmp = (char *)calloc(len + 1, 1);
 	read(tmp, len);
 
-	debug(9, "readPascalString: %d <%s>", len, transCyrillic((byte *)tmp));
+	debugC(9, kDebugLoading, "readPascalString: %d <%s>", len, transCyrillic((byte *)tmp));
 
 	return tmp;
 }
@@ -128,7 +128,7 @@ MemoryObject::~MemoryObject() {
 }
 
 bool MemoryObject::load(MfcArchive &file) {
-	debug(5, "MemoryObject::load()");
+	debugC(5, kDebugLoading, "MemoryObject::load()");
 	_memfilename = file.readPascalString();
 
 	if (char *p = strchr(_memfilename, '\\')) {
@@ -147,7 +147,7 @@ bool MemoryObject::load(MfcArchive &file) {
 }
 
 void MemoryObject::loadFile(char *filename) {
-	debug(5, "MemoryObject::loadFile(<%s>)", filename);
+	debugC(5, kDebugLoading, "MemoryObject::loadFile(<%s>)", filename);
 
 	if (!*filename)
 		return;
@@ -165,7 +165,7 @@ void MemoryObject::loadFile(char *filename) {
 
 			_dataSize = s->size();
 
-			debug(5, "Loading %s (%d bytes)", filename, _dataSize);
+			debugC(5, kDebugLoading, "Loading %s (%d bytes)", filename, _dataSize);
 			_data = (byte *)calloc(_dataSize, 1);
 			s->read(_data, _dataSize);
 
@@ -194,7 +194,7 @@ byte *MemoryObject::loadData() {
 }
 
 void MemoryObject::freeData() {
-	debug(8, "MemoryObject::freeData(): file: %s", _memfilename);
+	debugC(8, kDebugMemory, "MemoryObject::freeData(): file: %s", _memfilename);
 
 	if (_data)
 		free(_data);
@@ -222,12 +222,12 @@ MemoryObject2::~MemoryObject2() {
 }
 
 bool MemoryObject2::load(MfcArchive &file) {
-	debug(5, "MemoryObject2::load()");
+	debugC(5, kDebugLoading, "MemoryObject2::load()");
 	MemoryObject::load(file);
 
 	_mflags |= 1;
 
-	debug(5, "MemoryObject2::load: <%s>", _memfilename);
+	debugC(5, kDebugLoading, "MemoryObject2::load: <%s>", _memfilename);
 
 	if (_memfilename && *_memfilename) {
 		MemoryObject::loadFile(_memfilename);
@@ -377,15 +377,15 @@ CObject *MfcArchive::parseClass(bool *isCopyReturned) {
 
 	uint obTag = readUint16LE();
 
-	debug(7, "parseClass::obTag = %d (%04x)  at 0x%08x", obTag, obTag, pos() - 2);
+	debugC(7, kDebugLoading, "parseClass::obTag = %d (%04x)  at 0x%08x", obTag, obTag, pos() - 2);
 
 	if (obTag == 0xffff) {
 		int schema = readUint16LE();
 
-		debug(7, "parseClass::schema = %d", schema);
+		debugC(7, kDebugLoading, "parseClass::schema = %d", schema);
 
 		name = readPascalString(true);
-		debug(7, "parseClass::class <%s>", name);
+		debugC(7, kDebugLoading, "parseClass::class <%s>", name);
 
 		if (!_classMap.contains(name)) {
 			error("Unknown class in MfcArchive: <%s>", name);
@@ -393,7 +393,7 @@ CObject *MfcArchive::parseClass(bool *isCopyReturned) {
 
 		objectId = _classMap[name];
 
-		debug(7, "tag: %d 0x%x (%x)", _objectMap.size() - 1, _objectMap.size() - 1, objectId);
+		debugC(7, kDebugLoading, "tag: %d 0x%x (%x)", _objectMap.size() - 1, _objectMap.size() - 1, objectId);
 
 		res = createObject(objectId);
 		_objectMap.push_back(res);
@@ -407,7 +407,7 @@ CObject *MfcArchive::parseClass(bool *isCopyReturned) {
 		if (_objectMap.size() < obTag) {
 			error("Object index too big: %d  at 0x%08x", obTag, pos() - 2);
 		}
-		debug(7, "parseClass::obTag <%s>", lookupObjectId(_objectIdMap[obTag]));
+		debugC(7, kDebugLoading, "parseClass::obTag <%s>", lookupObjectId(_objectIdMap[obTag]));
 
 		res = _objectMap[obTag];
 
@@ -420,7 +420,7 @@ CObject *MfcArchive::parseClass(bool *isCopyReturned) {
 			error("Object index too big: %d  at 0x%08x", obTag, pos() - 2);
 		}
 
-		debug(7, "parseClass::obTag <%s>", lookupObjectId(_objectIdMap[obTag]));
+		debugC(7, kDebugLoading, "parseClass::obTag <%s>", lookupObjectId(_objectIdMap[obTag]));
 
 		objectId = _objectIdMap[obTag];
 
@@ -443,7 +443,7 @@ char *genFileName(int superId, int sceneId, const char *ext) {
 		snprintf(s, 255, "%04d.%s", sceneId, ext);
 	}
 
-	debug(7, "genFileName: %s", s);
+	debugC(7, kDebugLoading, "genFileName: %s", s);
 
 	return s;
 }






More information about the Scummvm-git-logs mailing list