Skip to content

Commit

Permalink
FULLPIPE: More debug output to loading
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Dec 8, 2017
1 parent 3938558 commit c728c29
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 6 deletions.
1 change: 1 addition & 0 deletions engines/fullpipe/fullpipe.cpp
Expand Up @@ -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()) {
Expand Down
3 changes: 2 additions & 1 deletion engines/fullpipe/fullpipe.h
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion engines/fullpipe/gfx.cpp
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions engines/fullpipe/messages.cpp
Expand Up @@ -107,7 +107,7 @@ bool ExCommand::load(MfcArchive &file) {

_objtype = kObjTypeExCommand;

debugC(6, kDebugLoading, "%% <COMMAND parent=%d cmd=%s x=%d y=%d f14=%d sceneX=%d sceneY=%d f20=%d f24=%d param=%d f2c=%d f30=%d f34=%d num=%d flags=%d parId=%d />",
debugC(6, kDebugXML, "%% <COMMAND parent=%d cmd=%s x=%d y=%d f14=%d sceneX=%d sceneY=%d f20=%d f24=%d param=%d f2c=%d f30=%d f34=%d num=%d flags=%d parId=%d />",
_parentId, exCommandType2str(_messageKind), _x, _y, _z, _sceneClickX, _sceneClickY, _field_20, _field_24, _param, _field_2C,
_field_30, _field_34, _messageNum, _excFlags, _parId);

Expand Down Expand Up @@ -240,7 +240,7 @@ bool ObjstateCommand::load(MfcArchive &file) {

_objCommandName = file.readPascalString();

debugC(6, kDebugLoading, "%% <COMMAND cmd=\"USER\" type=\"SET_LOGIC\" title=\"%s\" state=\"%d\" />", transCyrillic(_objCommandName.c_str()), _value);
debugC(6, kDebugXML, "%% <COMMAND cmd=\"USER\" type=\"SET_LOGIC\" title=\"%s\" state=\"%d\" />", transCyrillic(_objCommandName.c_str()), _value);

return true;
}
Expand Down
2 changes: 2 additions & 0 deletions engines/fullpipe/scenes/scene32.cpp
Expand Up @@ -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() {
Expand Down
26 changes: 24 additions & 2 deletions engines/fullpipe/statics.cpp
Expand Up @@ -163,6 +163,9 @@ bool StaticANIObject::load(MfcArchive &file) {

GameObject::load(file);

debugC(6, kDebugXML, "%% <OLDANI id=%d name=\"%s\" x=%d y=%d priority=%d f8=%d>",
_id, transCyrillic(_objectName), _ox, _oy, _priority, _field_8);

int count = file.readUint16LE();

for (int i = 0; i < count; i++) {
Expand Down Expand Up @@ -197,6 +200,8 @@ bool StaticANIObject::load(MfcArchive &file) {
pt.x = pt.y = 100;
}

debugC(6, kDebugXML, "%% </OLDANI>");

setOXY(pt.x, pt.y);

return true;
Expand Down Expand Up @@ -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, "%% <STATICS id=%d name=\"%s\" f7c=%d %s />",
_staticsId, transCyrillic(_staticsName), _field_7C, DynamicPhase::toXML().c_str());

_picture.load(file);

Expand Down Expand Up @@ -1573,14 +1579,18 @@ bool Movement::load(MfcArchive &file, StaticANIObject *ani) {

int dynCount = file.readUint16LE();

debugC(7, kDebugLoading, "dynCount: %d _id: %d", dynCount, _id);
debugC(6, kDebugXML, "%% <MOVEMENT id=%d name=\"%s\" x=%d y=%d priority=%d f8=%d>",
_id, transCyrillic(_objectName), _ox, _oy, _priority, _field_8);

if (dynCount != 0xffff || _id == MV_MAN_TURN_LU) {
_framePosOffsets.resize(dynCount + 2);

for (int i = 0; i < dynCount; i++) {
DynamicPhase *ph = new DynamicPhase();
ph->load(file);

debugC(6, kDebugXML, "%% <PHASE %s />", ph->toXML().c_str());

_dynamicPhases.push_back(ph);

_framePosOffsets[i].x = ph->_x;
Expand Down Expand Up @@ -1644,6 +1654,8 @@ bool Movement::load(MfcArchive &file, StaticANIObject *ani) {
_counter = 0;
updateCurrDynamicPhase();

debugC(6, kDebugXML, "%% </MOVEMENT>");

return true;
}

Expand Down Expand Up @@ -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()");

Expand Down Expand Up @@ -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()");

Expand Down
4 changes: 4 additions & 0 deletions engines/fullpipe/statics.h
Expand Up @@ -60,6 +60,8 @@ class StaticPhase : public Picture {

virtual bool load(MfcArchive &file);

virtual Common::String toXML();

ExCommand *getExCommand() { return _exCommand.get(); }
};

Expand All @@ -78,6 +80,8 @@ class DynamicPhase : public StaticPhase {

virtual bool load(MfcArchive &file);

virtual Common::String toXML();

int getDynFlags() { return _dynFlags; }
};

Expand Down

0 comments on commit c728c29

Please sign in to comment.