From c728c29857d12ddc039a2982b9bd510ed6a9f620 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 8 Dec 2017 20:29:30 +0000 Subject: [PATCH] FULLPIPE: More debug output to loading --- engines/fullpipe/fullpipe.cpp | 1 + engines/fullpipe/fullpipe.h | 3 ++- engines/fullpipe/gfx.cpp | 3 ++- engines/fullpipe/messages.cpp | 4 ++-- engines/fullpipe/scenes/scene32.cpp | 2 ++ engines/fullpipe/statics.cpp | 26 ++++++++++++++++++++++++-- engines/fullpipe/statics.h | 4 ++++ 7 files changed, 37 insertions(+), 6 deletions(-) diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp index ec2b5aa71d79..fef896d663f0 100644 --- a/engines/fullpipe/fullpipe.cpp +++ b/engines/fullpipe/fullpipe.cpp @@ -67,6 +67,7 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc) DebugMan.addDebugChannel(kDebugInventory, "inventory", "Inventory"); DebugMan.addDebugChannel(kDebugSceneLogic, "scenelogic", "Scene Logic"); DebugMan.addDebugChannel(kDebugInteractions, "interactions", "Interactions"); + DebugMan.addDebugChannel(kDebugXML, "xml", "XML"); // Setup mixer if (!_mixer->isReady()) { diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h index 2039989c9190..08c6de2621ce 100644 --- a/engines/fullpipe/fullpipe.h +++ b/engines/fullpipe/fullpipe.h @@ -59,7 +59,8 @@ enum { kDebugBehavior = 1 << 6, kDebugInventory = 1 << 7, kDebugSceneLogic = 1 << 8, - kDebugInteractions = 1 << 9 + kDebugInteractions = 1 << 9, + kDebugXML = 1 << 10 }; class BehaviorManager; diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp index a2626e28eaba..667c2ba1905b 100644 --- a/engines/fullpipe/gfx.cpp +++ b/engines/fullpipe/gfx.cpp @@ -463,7 +463,8 @@ bool Picture::load(MfcArchive &file) { getData(); - debugC(5, kDebugLoading, "Picture::load: loaded <%s>", _memfilename.c_str()); + debugC(5, kDebugLoading, "Picture::load: loaded memobject=\"%s\" x=%d y=%d f44=%d width=%d height=%d alpha=%d memobject2=\"%s\"", _memfilename.c_str(), + _x, _y, _field_44, _width, _height, _alpha, _memoryObject2->_memfilename.c_str()); return true; } diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp index 7c69ae8a0f11..0272e82f58af 100644 --- a/engines/fullpipe/messages.cpp +++ b/engines/fullpipe/messages.cpp @@ -107,7 +107,7 @@ bool ExCommand::load(MfcArchive &file) { _objtype = kObjTypeExCommand; - debugC(6, kDebugLoading, "%% ", + debugC(6, kDebugXML, "%% ", _parentId, exCommandType2str(_messageKind), _x, _y, _z, _sceneClickX, _sceneClickY, _field_20, _field_24, _param, _field_2C, _field_30, _field_34, _messageNum, _excFlags, _parId); @@ -240,7 +240,7 @@ bool ObjstateCommand::load(MfcArchive &file) { _objCommandName = file.readPascalString(); - debugC(6, kDebugLoading, "%% ", transCyrillic(_objCommandName.c_str()), _value); + debugC(6, kDebugXML, "%% ", transCyrillic(_objCommandName.c_str()), _value); return true; } diff --git a/engines/fullpipe/scenes/scene32.cpp b/engines/fullpipe/scenes/scene32.cpp index 593f7b446c63..d4b4a6527ff5 100644 --- a/engines/fullpipe/scenes/scene32.cpp +++ b/engines/fullpipe/scenes/scene32.cpp @@ -91,6 +91,8 @@ void scene32_initScene(Scene *sc) { g_fp->lift_init(sc, QU_SC32_ENTERLIFT, QU_SC32_EXITLIFT); g_fp->initArcadeKeys("SC_32"); + + warning("cactus: %d, state: %d", g_fp->getObjectState(sO_Cactus), g_vars->scene32_cactus->_statics->_staticsId); } void scene32_setupMusic() { diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index a1252a75af03..b5baa180fa6c 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -163,6 +163,9 @@ bool StaticANIObject::load(MfcArchive &file) { GameObject::load(file); + debugC(6, kDebugXML, "%% ", + _id, transCyrillic(_objectName), _ox, _oy, _priority, _field_8); + int count = file.readUint16LE(); for (int i = 0; i < count; i++) { @@ -197,6 +200,8 @@ bool StaticANIObject::load(MfcArchive &file) { pt.x = pt.y = 100; } + debugC(6, kDebugXML, "%% "); + setOXY(pt.x, pt.y); return true; @@ -1371,7 +1376,8 @@ bool Statics::load(MfcArchive &file) { _staticsId = file.readUint16LE(); _staticsName = file.readPascalString(); - debugC(7, kDebugLoading, "statics: <%s> id: %d (%x)", transCyrillic(_staticsName), _staticsId, _staticsId); + debugC(6, kDebugXML, "%% ", + _staticsId, transCyrillic(_staticsName), _field_7C, DynamicPhase::toXML().c_str()); _picture.load(file); @@ -1573,7 +1579,9 @@ bool Movement::load(MfcArchive &file, StaticANIObject *ani) { int dynCount = file.readUint16LE(); - debugC(7, kDebugLoading, "dynCount: %d _id: %d", dynCount, _id); + debugC(6, kDebugXML, "%% ", + _id, transCyrillic(_objectName), _ox, _oy, _priority, _field_8); + if (dynCount != 0xffff || _id == MV_MAN_TURN_LU) { _framePosOffsets.resize(dynCount + 2); @@ -1581,6 +1589,8 @@ bool Movement::load(MfcArchive &file, StaticANIObject *ani) { DynamicPhase *ph = new DynamicPhase(); ph->load(file); + debugC(6, kDebugXML, "%% ", ph->toXML().c_str()); + _dynamicPhases.push_back(ph); _framePosOffsets[i].x = ph->_x; @@ -1644,6 +1654,8 @@ bool Movement::load(MfcArchive &file, StaticANIObject *ani) { _counter = 0; updateCurrDynamicPhase(); + debugC(6, kDebugXML, "%% "); + return true; } @@ -2127,6 +2139,12 @@ DynamicPhase::DynamicPhase(DynamicPhase *src, bool reverse) { copyMemoryObject2(*src); } +Common::String DynamicPhase::toXML() { + return Common::String::format("f7c=%d left=%d top=%d right=%d bottom=%d sX=%d sY=%d dynFlags=%d %s", + _field_7C, _rect.left, _rect.top, _rect.right, _rect.bottom, _someX, _someY, _dynFlags, + StaticPhase::toXML().c_str()); +} + bool DynamicPhase::load(MfcArchive &file) { debugC(5, kDebugLoading, "DynamicPhase::load()"); @@ -2157,6 +2175,10 @@ StaticPhase::StaticPhase() { _field_68 = 0; } +Common::String StaticPhase::toXML() { + return Common::String::format("countdown=%d f6a=%d", _initialCountdown, _field_6A); +} + bool StaticPhase::load(MfcArchive &file) { debugC(5, kDebugLoading, "StaticPhase::load()"); diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h index b0e083e21232..770d431bd872 100644 --- a/engines/fullpipe/statics.h +++ b/engines/fullpipe/statics.h @@ -60,6 +60,8 @@ class StaticPhase : public Picture { virtual bool load(MfcArchive &file); + virtual Common::String toXML(); + ExCommand *getExCommand() { return _exCommand.get(); } }; @@ -78,6 +80,8 @@ class DynamicPhase : public StaticPhase { virtual bool load(MfcArchive &file); + virtual Common::String toXML(); + int getDynFlags() { return _dynFlags; } };