Skip to content

Commit

Permalink
PINK: Implemented debug output of Objects
Browse files Browse the repository at this point in the history
  • Loading branch information
whitertandrek authored and sev- committed Jun 28, 2018
1 parent f62132c commit 113540b
Show file tree
Hide file tree
Showing 17 changed files with 55 additions and 11 deletions.
2 changes: 1 addition & 1 deletion engines/pink/actions/action.h
Expand Up @@ -33,7 +33,7 @@ class Action : public NamedObject {
public:
virtual void deserialize(Archive &archive);

private:
protected:
Actor *_actor;
};

Expand Down
2 changes: 1 addition & 1 deletion engines/pink/actions/action_cel.h
Expand Up @@ -31,7 +31,7 @@ class ActionCEL : public Action {
public:
virtual void deserialize(Archive &archive);

private:
protected:
Common::String _fileName;
uint32 _z; // Z coordinate for sprite
};
Expand Down
3 changes: 3 additions & 0 deletions engines/pink/actions/action_play.cpp
Expand Up @@ -20,6 +20,7 @@
*
*/

#include <common/debug.h>
#include "action_play.h"
#include "../archive.h"

Expand All @@ -28,6 +29,8 @@ namespace Pink {
void ActionPlay::deserialize(Archive &archive) {
ActionStill::deserialize(archive);
archive >> _stopFrame;
debug("\tActionPlay: _name = %s, _fileName = %s, z = %u, _startFrame = %u,"
" _endFrame = %u", _name.c_str(), _fileName.c_str(), _z, _startFrame, _stopFrame);
}

} // End of namespace Pink
3 changes: 3 additions & 0 deletions engines/pink/actions/action_sound.cpp
Expand Up @@ -20,6 +20,7 @@
*
*/

#include <common/debug.h>
#include "action_sound.h"
#include "../archive.h"

Expand All @@ -31,6 +32,8 @@ void ActionSound::deserialize(Archive &archive) {
_volume = archive.readDWORD();
_isLoop = (bool) archive.readDWORD();
_isBackground = (bool) archive.readDWORD();
debug("\tActionSound: _name = %s, _fileName = %s, _volume = %u, _isLoop = %u,"
" _isBackground = %u", _name.c_str(), _fileName.c_str(), _volume, _isLoop, _isBackground);
}

} // End of namespace Pink
2 changes: 1 addition & 1 deletion engines/pink/actions/action_still.h
Expand Up @@ -31,7 +31,7 @@ class ActionStill : public ActionCEL {
public:
virtual void deserialize(Archive &archive);

private:
protected:
uint32 _startFrame;
};

Expand Down
4 changes: 4 additions & 0 deletions engines/pink/actors/actor.cpp
Expand Up @@ -22,12 +22,16 @@

#include "actor.h"
#include "../page.h"
#include "lead_actor.h"

namespace Pink {

void Actor::deserialize(Archive &archive) {
NamedObject::deserialize(archive);
_page = static_cast<GamePage*>(archive.readObject());
if (dynamic_cast<LeadActor*>(this))
debug("LeadActor: _name = %s", _name.c_str());
else debug("Actor: _name = %s", _name.c_str());
archive >> _actions;
}

Expand Down
2 changes: 1 addition & 1 deletion engines/pink/handlers/handler.h
Expand Up @@ -34,7 +34,7 @@ class Handler : public Object {
public:
virtual void deserialize(Archive &archive);

private:
protected:
//_conditions
Common::Array<SideEffect*> _sideEffects;
};
Expand Down
2 changes: 1 addition & 1 deletion engines/pink/handlers/handler_sequences.h
Expand Up @@ -31,7 +31,7 @@ class HandlerSequences : public Handler {
public:
virtual void deserialize(Archive &archive);

private:
protected:
StringArray _sequences;
};

Expand Down
13 changes: 13 additions & 0 deletions engines/pink/handlers/handler_start_page.cpp
Expand Up @@ -20,6 +20,19 @@
*
*/

#include "handler_start_page.h"
#include <common/debug.h>
#include "../archive.h"

namespace Pink {

void HandlerStartPage::deserialize(Archive &archive) {
debug("HandlerStartPage: ");
HandlerSequences::deserialize(archive);

for (uint i = 0; i < _sequences.size(); ++i) {
debug("\t%s", _sequences[i].c_str());
}
}

} // End of namespace Pink
3 changes: 2 additions & 1 deletion engines/pink/handlers/handler_start_page.h
Expand Up @@ -29,7 +29,8 @@
namespace Pink {

class HandlerStartPage : public HandlerSequences {

public:
virtual void deserialize(Archive &archive);
};

} // End of namespace Pink
Expand Down
1 change: 1 addition & 0 deletions engines/pink/object.cpp
Expand Up @@ -20,6 +20,7 @@
*
*/

#include <common/debug.h>
#include "object.h"
#include "archive.h"

Expand Down
2 changes: 1 addition & 1 deletion engines/pink/object.h
Expand Up @@ -48,7 +48,7 @@ class NamedObject : public Object {

const Common::String &getName() const;

private:
protected:
Common::String _name;
};

Expand Down
2 changes: 1 addition & 1 deletion engines/pink/page.cpp
Expand Up @@ -71,7 +71,7 @@ void GamePage::loadFields() {

_resMgr.init(_module->getGame(), this);

// memfile manipulations
// memfile manipulations if from save or page changing

}

Expand Down
3 changes: 3 additions & 0 deletions engines/pink/side_effects/side_effect_exit.cpp
Expand Up @@ -20,13 +20,16 @@
*
*/

#include <common/debug.h>
#include "side_effect_exit.h"
#include "../archive.h"

namespace Pink {

void SideEffectExit::deserialize(Archive &archive) {
archive >> _nextModule >> _nextPage;
debug("\tSideEffectExit: _nextModule = %s, _nextPage = %s",
_nextModule.c_str(), _nextPage.c_str());
}

} // End of namespace Pink
15 changes: 15 additions & 0 deletions engines/pink/side_effects/side_effect_module_variable.cpp
@@ -1,3 +1,7 @@
#include <engines/pink/archive.h>
#include <common/debug.h>
#include "side_effect_variable.h"

/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
Expand All @@ -20,3 +24,14 @@
*
*/

#include "side_effect_module_variable.h"

namespace Pink {

void SideEffectModuleVariable::deserialize(Archive &archive) {
SideEffectVariable::deserialize(archive);
debug("\tSideEffectModuleVariable: _name = %s _value = %s",
_name.c_str(), _value.c_str());
}

}
5 changes: 3 additions & 2 deletions engines/pink/side_effects/side_effect_module_variable.h
Expand Up @@ -27,9 +27,10 @@
namespace Pink {

class SideEffectModuleVariable : public SideEffectVariable {

public:
virtual void deserialize(Archive &archive);
};

}
} // End of namespace Pink

#endif
2 changes: 1 addition & 1 deletion engines/pink/side_effects/side_effect_variable.h
Expand Up @@ -31,7 +31,7 @@ class SideEffectVariable : public SideEffect {
public:
virtual void deserialize(Archive &archive);

private:
protected:
Common::String _name;
Common::String _value;
};
Expand Down

0 comments on commit 113540b

Please sign in to comment.