From 1fb5f55b704ae57ddc3c103a22ab466cf93aa94a Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 28 Jul 2016 00:10:02 +0300 Subject: [PATCH] FULLPIPE: Added more debug channels --- engines/fullpipe/fullpipe.cpp | 2 ++ engines/fullpipe/fullpipe.h | 3 ++- engines/fullpipe/motion.cpp | 38 +++++++++++++++++------------------ engines/fullpipe/scene.cpp | 24 +++++++++++----------- engines/fullpipe/statics.cpp | 20 +++++++++--------- 5 files changed, 45 insertions(+), 42 deletions(-) diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp index cef3d5ce743..fcfe78aa7a6 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 afd4fd91d4e..ccbbf601b30 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 f0304467cfb..2829bdca5c1 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 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 067fbff76ca..b47988d7688 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 &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 059fd82e79f..d4045b1ea4c 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);