aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/pink/objects/actions/action_hide.cpp7
-rw-r--r--engines/pink/objects/actions/action_loop.cpp7
-rw-r--r--engines/pink/objects/actions/action_loop.h2
-rw-r--r--engines/pink/objects/actions/action_play.cpp7
-rw-r--r--engines/pink/objects/actions/action_play_with_sfx.cpp11
-rw-r--r--engines/pink/objects/actions/action_play_with_sfx.h2
-rw-r--r--engines/pink/objects/actions/action_sound.cpp6
-rw-r--r--engines/pink/objects/actions/action_still.cpp7
-rw-r--r--engines/pink/objects/actions/action_talk.cpp3
-rw-r--r--engines/pink/objects/actions/action_text.cpp5
-rw-r--r--engines/pink/objects/actions/walk_action.cpp3
-rw-r--r--engines/pink/objects/actors/actor.cpp3
-rw-r--r--engines/pink/objects/actors/audio_info_pda_button.cpp3
-rw-r--r--engines/pink/objects/actors/cursor_actor.h3
-rw-r--r--engines/pink/objects/actors/inventory_actor.h2
-rw-r--r--engines/pink/objects/actors/lead_actor.cpp6
-rw-r--r--engines/pink/objects/actors/pda_button_actor.cpp2
-rw-r--r--engines/pink/objects/actors/supporting_actor.cpp3
-rw-r--r--engines/pink/objects/condition.cpp14
-rw-r--r--engines/pink/objects/handlers/handler.cpp30
-rw-r--r--engines/pink/objects/handlers/handler_mgr.cpp3
-rw-r--r--engines/pink/objects/handlers/handler_timer.cpp25
-rw-r--r--engines/pink/objects/handlers/handler_timer.h2
-rw-r--r--engines/pink/objects/inventory.cpp4
-rw-r--r--engines/pink/objects/pages/game_page.cpp5
-rw-r--r--engines/pink/objects/pages/page.cpp2
-rw-r--r--engines/pink/objects/sequences/seq_timer.cpp2
-rw-r--r--engines/pink/objects/sequences/sequence.cpp13
-rw-r--r--engines/pink/objects/sequences/sequence_context.cpp5
-rw-r--r--engines/pink/objects/sequences/sequence_item.cpp9
-rw-r--r--engines/pink/objects/sequences/sequencer.cpp15
-rw-r--r--engines/pink/objects/side_effect.cpp14
-rw-r--r--engines/pink/objects/walk/walk_location.cpp7
-rw-r--r--engines/pink/objects/walk/walk_mgr.cpp3
-rw-r--r--engines/pink/pink.cpp14
-rw-r--r--engines/pink/pink.h4
-rw-r--r--engines/pink/resource_mgr.cpp3
37 files changed, 143 insertions, 113 deletions
diff --git a/engines/pink/objects/actions/action_hide.cpp b/engines/pink/objects/actions/action_hide.cpp
index a2435c4ab9..10c41c247e 100644
--- a/engines/pink/objects/actions/action_hide.cpp
+++ b/engines/pink/objects/actions/action_hide.cpp
@@ -21,22 +21,23 @@
*/
#include "pink/archive.h"
+#include "pink/pink.h"
#include "pink/objects/actions/action_hide.h"
#include "pink/objects/actors/actor.h"
namespace Pink {
void ActionHide::toConsole() {
- debug("\tActionHide: _name = %s", _name.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\tActionHide: _name = %s", _name.c_str());
}
void ActionHide::start() {
- debug("Actor %s has now ActionHide %s", _actor->getName().c_str(), _name.c_str());
+ debugC(6, kPinkDebugActions, "Actor %s has now ActionHide %s", _actor->getName().c_str(), _name.c_str());
_actor->endAction();
}
void ActionHide::end() {
- debug("ActionHide %s of Actor %s is ended", _name.c_str(), _actor->getName().c_str());
+ debugC(6, kPinkDebugActions, "ActionHide %s of Actor %s is ended", _name.c_str(), _actor->getName().c_str());
}
} //End of namespace Pink
diff --git a/engines/pink/objects/actions/action_loop.cpp b/engines/pink/objects/actions/action_loop.cpp
index ca649b2caf..c8ef5da9d9 100644
--- a/engines/pink/objects/actions/action_loop.cpp
+++ b/engines/pink/objects/actions/action_loop.cpp
@@ -48,7 +48,7 @@ void ActionLoop::deserialize(Archive &archive) {
}
void ActionLoop::toConsole() {
- debug("\tActionLoop: _name = %s, _fileName = %s, z = %u, _startFrame = %u,"
+ debugC(6, kPinkDebugLoadingObjects, "\tActionLoop: _name = %s, _fileName = %s, z = %u, _startFrame = %u,"
" _endFrame = %d, _intro = %u, _style = %u",
_name.c_str(), _fileName.c_str(), _z, _startFrame, _stopFrame, _intro, _style);
}
@@ -116,4 +116,9 @@ void ActionLoop::onStart() {
_forward = true;
}
+void ActionLoop::end() {
+ ActionCEL::end();
+ debugC(6, kPinkDebugActions, "ActionLoop %s of Actor %s is ended", _name.c_str(), _actor->getName().c_str());
+}
+
} // End of namespace Pink
diff --git a/engines/pink/objects/actions/action_loop.h b/engines/pink/objects/actions/action_loop.h
index 263d5a665d..15e9784d66 100644
--- a/engines/pink/objects/actions/action_loop.h
+++ b/engines/pink/objects/actions/action_loop.h
@@ -35,6 +35,8 @@ public:
void update() override;
+ void end() override;
+
protected:
void onStart() override;
virtual bool isTalk() { return false; }
diff --git a/engines/pink/objects/actions/action_play.cpp b/engines/pink/objects/actions/action_play.cpp
index 6d23a8accd..fb4f05f0cb 100644
--- a/engines/pink/objects/actions/action_play.cpp
+++ b/engines/pink/objects/actions/action_play.cpp
@@ -24,6 +24,7 @@
#include "pink/archive.h"
#include "pink/cel_decoder.h"
+#include "pink/pink.h"
#include "pink/objects/actions/action_play.h"
#include "pink/objects/actors/actor.h"
@@ -35,13 +36,13 @@ void ActionPlay::deserialize(Archive &archive) {
}
void ActionPlay::toConsole() {
- debug("\tActionPlay: _name = %s, _fileName = %s, z = %u, _startFrame = %u,"
+ debugC(6, kPinkDebugLoadingObjects, "\tActionPlay: _name = %s, _fileName = %s, z = %u, _startFrame = %u,"
" _endFrame = %d", _name.c_str(), _fileName.c_str(), _z, _startFrame, _stopFrame);
}
void ActionPlay::end() {
ActionCEL::end();
- debug("ActionPlay %s of Actor %s is ended", _name.c_str(), _actor->getName().c_str());
+ debugC(6, kPinkDebugActions, "ActionPlay %s of Actor %s is ended", _name.c_str(), _actor->getName().c_str());
}
void ActionPlay::update() {
@@ -59,7 +60,7 @@ void ActionPlay::pause(bool paused) {
}
void ActionPlay::onStart() {
- debug("Actor %s has now ActionPlay %s", _actor->getName().c_str(), _name.c_str());
+ debugC(6, kPinkDebugActions, "Actor %s has now ActionPlay %s", _actor->getName().c_str(), _name.c_str());
int frameCount = _decoder.getFrameCount();
if (_stopFrame == -1 || _stopFrame >= frameCount)
_stopFrame = frameCount - 1;
diff --git a/engines/pink/objects/actions/action_play_with_sfx.cpp b/engines/pink/objects/actions/action_play_with_sfx.cpp
index 78c302208d..0c8aa94c2c 100644
--- a/engines/pink/objects/actions/action_play_with_sfx.cpp
+++ b/engines/pink/objects/actions/action_play_with_sfx.cpp
@@ -22,6 +22,7 @@
#include "pink/cel_decoder.h"
#include "pink/sound.h"
+#include "pink/pink.h"
#include "pink/objects/actors/actor.h"
#include "pink/objects/actions/action_play_with_sfx.h"
#include "pink/objects/pages/game_page.h"
@@ -42,7 +43,7 @@ void ActionPlayWithSfx::deserialize(Pink::Archive &archive) {
}
void ActionPlayWithSfx::toConsole() {
- debug("\tActionPlayWithSfx: _name = %s, _fileName = %s, z = %u, _startFrame = %u,"
+ debugC(6, kPinkDebugLoadingObjects, "\tActionPlayWithSfx: _name = %s, _fileName = %s, z = %u, _startFrame = %u,"
" _endFrame = %d, _isLoop = %u", _name.c_str(), _fileName.c_str(), _z, _startFrame, _stopFrame, _isLoop);
for (uint i = 0; i < _sfxArray.size(); ++i) {
_sfxArray[i]->toConsole();
@@ -70,6 +71,11 @@ void ActionPlayWithSfx::onStart() {
_actor->endAction();
}
+void ActionPlayWithSfx::end() {
+ ActionCEL::end();
+ debugC(6, kPinkDebugActions, "ActionPlayWithSfx %s of Actor %s is ended", _name.c_str(), _actor->getName().c_str());
+}
+
void ActionSfx::deserialize(Pink::Archive &archive) {
_frame = archive.readDWORD();
_volume = archive.readDWORD();
@@ -79,12 +85,13 @@ void ActionSfx::deserialize(Pink::Archive &archive) {
}
void ActionSfx::toConsole() {
- debug("\t\tActionSfx: _sfx = %s, _volume = %u, _frame = %u", _sfxName.c_str(), _volume, _frame);
+ debugC(6, kPinkDebugLoadingObjects, "\t\tActionSfx: _sfx = %s, _volume = %u, _frame = %u", _sfxName.c_str(), _volume, _frame);
}
void ActionSfx::play() {
Page *page = _sprite->getActor()->getPage();
if (!_sound.isPlaying()) {
+ debugC(kPinkDebugActions, "ActionSfx %s of %s is now playing", _sfxName.c_str(), _sprite->getName().c_str());
int8 balance = (_sprite->getDecoder()->getCenter().x * 396875 / 1000000) - 127;
_sound.play(page->getResourceStream(_sfxName), Audio::Mixer::kSFXSoundType, _volume, balance);
}
diff --git a/engines/pink/objects/actions/action_play_with_sfx.h b/engines/pink/objects/actions/action_play_with_sfx.h
index 64a19d46cb..2797604671 100644
--- a/engines/pink/objects/actions/action_play_with_sfx.h
+++ b/engines/pink/objects/actions/action_play_with_sfx.h
@@ -42,6 +42,8 @@ public:
void update() override;
+ void end() override;
+
protected:
void onStart() override;
diff --git a/engines/pink/objects/actions/action_sound.cpp b/engines/pink/objects/actions/action_sound.cpp
index 6c13c42ac2..4d4918f0f1 100644
--- a/engines/pink/objects/actions/action_sound.cpp
+++ b/engines/pink/objects/actions/action_sound.cpp
@@ -46,7 +46,7 @@ void ActionSound::deserialize(Archive &archive) {
}
void ActionSound::toConsole() {
- debug("\tActionSound: _name = %s, _fileName = %s, _volume = %u, _isLoop = %u,"
+ debugC(6, kPinkDebugLoadingObjects, "\tActionSound: _name = %s, _fileName = %s, _volume = %u, _isLoop = %u,"
" _isBackground = %u", _name.c_str(), _fileName.c_str(), _volume, _isLoop, _isBackground);
}
@@ -62,7 +62,7 @@ void ActionSound::start() {
_sound.play(page->getResourceStream(_fileName), soundType, _volume, 0, _isLoop);
- debug("Actor %s has now ActionSound %s", _actor->getName().c_str(), _name.c_str());
+ debugC(6, kPinkDebugActions, "Actor %s has now ActionSound %s", _actor->getName().c_str(), _name.c_str());
}
void ActionSound::end() {
@@ -72,7 +72,7 @@ void ActionSound::end() {
director->removeSound(this);
}
- debug("ActionSound %s of Actor %s is ended", _name.c_str(), _actor->getName().c_str());
+ debugC(6, kPinkDebugActions, "ActionSound %s of Actor %s is ended", _name.c_str(), _actor->getName().c_str());
}
void ActionSound::update() {
diff --git a/engines/pink/objects/actions/action_still.cpp b/engines/pink/objects/actions/action_still.cpp
index 345b42e4e9..715051542f 100644
--- a/engines/pink/objects/actions/action_still.cpp
+++ b/engines/pink/objects/actions/action_still.cpp
@@ -24,6 +24,7 @@
#include "pink/archive.h"
#include "pink/cel_decoder.h"
+#include "pink/pink.h"
#include "pink/objects/actions/action_still.h"
#include "pink/objects/actors/actor.h"
@@ -35,19 +36,19 @@ void ActionStill::deserialize(Archive &archive) {
}
void ActionStill::toConsole() {
- debug("\tActionStill: _name = %s, _fileName = %s, _z =%u _startFrame = %u",
+ debugC(6, kPinkDebugLoadingObjects, "\tActionStill: _name = %s, _fileName = %s, _z =%u _startFrame = %u",
_name.c_str(), _fileName.c_str(), _z, _startFrame);
}
void ActionStill::end() {
ActionCEL::end();
- debug("ActionStill %s of Actor %s is ended", _name.c_str(), _actor->getName().c_str());
+ debugC(6, kPinkDebugActions, "ActionStill %s of Actor %s is ended", _name.c_str(), _actor->getName().c_str());
}
void ActionStill::pause(bool paused) {}
void ActionStill::onStart() {
- debug("Actor %s has now ActionStill %s", _actor->getName().c_str(), _name.c_str());
+ debugC(6, kPinkDebugActions, "Actor %s has now ActionStill %s", _actor->getName().c_str(), _name.c_str());
if (_startFrame >= _decoder.getFrameCount())
_startFrame = 0;
diff --git a/engines/pink/objects/actions/action_talk.cpp b/engines/pink/objects/actions/action_talk.cpp
index 1ea29377d9..6e51507989 100644
--- a/engines/pink/objects/actions/action_talk.cpp
+++ b/engines/pink/objects/actions/action_talk.cpp
@@ -22,6 +22,7 @@
#include "pink/archive.h"
#include "pink/cel_decoder.h"
+#include "pink/pink.h"
#include "pink/sound.h"
#include "pink/objects/actions/action_talk.h"
#include "pink/objects/actors/actor.h"
@@ -35,7 +36,7 @@ void ActionTalk::deserialize(Archive &archive) {
}
void ActionTalk::toConsole() {
- debug("\tActionTalk: _name = %s, _fileName = %s, z = %u, _startFrame = %u,"
+ debugC(6, kPinkDebugLoadingObjects, "\tActionTalk: _name = %s, _fileName = %s, z = %u, _startFrame = %u,"
" _endFrame = %d, _intro = %u, _style = %u, _vox = %s",
_name.c_str(), _fileName.c_str(), _z, _startFrame, _stopFrame, _intro, _style, _vox.c_str());
}
diff --git a/engines/pink/objects/actions/action_text.cpp b/engines/pink/objects/actions/action_text.cpp
index bf080719ad..1af06d5e82 100644
--- a/engines/pink/objects/actions/action_text.cpp
+++ b/engines/pink/objects/actions/action_text.cpp
@@ -23,6 +23,9 @@
#include "common/debug.h"
#include "pink/archive.h"
+#include "pink/director.h"
+#include "pink/pink.h"
+#include "pink/objects/actors/actor.h"
#include "pink/objects/actions/action_text.h"
namespace Pink {
@@ -43,7 +46,7 @@ void ActionText::deserialize(Archive &archive) {
}
void ActionText::toConsole() {
- debug("\tActionText: _name = %s, _fileName = %s, "
+ debugC(6, kPinkDebugLoadingObjects, "\tActionText: _name = %s, _fileName = %s, "
"_xLeft = %u, _yTop = %u, _xRight = %u, _yBottom = %u _centered = %u, _scrollBar = %u, _textColor = %u _backgroundColor = %u",
_name.c_str(), _fileName.c_str(), _xLeft, _yTop, _xRight, _yBottom, _centered, _scrollBar, _textColor, _backgroundColor);
}
diff --git a/engines/pink/objects/actions/walk_action.cpp b/engines/pink/objects/actions/walk_action.cpp
index 167cdec8cd..fb184d83cb 100644
--- a/engines/pink/objects/actions/walk_action.cpp
+++ b/engines/pink/objects/actions/walk_action.cpp
@@ -22,6 +22,7 @@
#include "pink/archive.h"
#include "pink/cel_decoder.h"
+#include "pink/pink.h"
#include "pink/objects/actions/walk_action.h"
#include "pink/objects/actors/actor.h"
@@ -34,7 +35,7 @@ void WalkAction::deserialize(Archive &archive) {
}
void WalkAction::toConsole() {
- debug("\tWalkAction: _name = %s, _fileName = %s, _calcFramePositions = %u",
+ debugC(6, kPinkDebugLoadingObjects, "\tWalkAction: _name = %s, _fileName = %s, _calcFramePositions = %u",
_name.c_str(), _fileName.c_str(), _toCalcFramePositions);
}
diff --git a/engines/pink/objects/actors/actor.cpp b/engines/pink/objects/actors/actor.cpp
index 34af26f597..66f30904dd 100644
--- a/engines/pink/objects/actors/actor.cpp
+++ b/engines/pink/objects/actors/actor.cpp
@@ -22,6 +22,7 @@
#include "pink/constants.h"
#include "pink/cursor_mgr.h"
+#include "pink/pink.h"
#include "pink/objects/actions/action_cel.h"
#include "pink/objects/actors/actor.h"
#include "pink/objects/actors/lead_actor.h"
@@ -80,7 +81,7 @@ bool Actor::initPalette(Director *director) {
}
void Actor::toConsole() {
- debug("Actor: _name = %s", _name.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "Actor: _name = %s", _name.c_str());
for (uint i = 0; i < _actions.size(); ++i) {
_actions[i]->toConsole();
}
diff --git a/engines/pink/objects/actors/audio_info_pda_button.cpp b/engines/pink/objects/actors/audio_info_pda_button.cpp
index af03d5adf6..ceb7df6666 100644
--- a/engines/pink/objects/actors/audio_info_pda_button.cpp
+++ b/engines/pink/objects/actors/audio_info_pda_button.cpp
@@ -20,6 +20,7 @@
*
*/
+#include "pink/pink.h"
#include "pink/objects/actors/audio_info_pda_button.h"
#include "pink/objects/actors/lead_actor.h"
#include "pink/objects/pages/page.h"
@@ -27,7 +28,7 @@
namespace Pink {
void AudioInfoPDAButton::toConsole() {
- debug("AudioInfoPDAButton: _name = %s", _name.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "AudioInfoPDAButton: _name = %s", _name.c_str());
for (uint i = 0; i < _actions.size(); ++i) {
_actions[i]->toConsole();
}
diff --git a/engines/pink/objects/actors/cursor_actor.h b/engines/pink/objects/actors/cursor_actor.h
index ff4c5de9c3..de1fea004b 100644
--- a/engines/pink/objects/actors/cursor_actor.h
+++ b/engines/pink/objects/actors/cursor_actor.h
@@ -25,6 +25,7 @@
#include "common/debug.h"
+#include "pink/pink.h"
#include "pink/objects/actions/action_cel.h"
#include "pink/objects/actors/actor.h"
@@ -33,7 +34,7 @@ namespace Pink {
class CursorActor : public Actor {
public:
void toConsole() override {
- debug("CursorActor: _name = %s", _name.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "CursorActor: _name = %s", _name.c_str());
for (uint i = 0; i < _actions.size(); ++i) {
_actions[i]->toConsole();
}
diff --git a/engines/pink/objects/actors/inventory_actor.h b/engines/pink/objects/actors/inventory_actor.h
index cfd4408fb9..574c14b761 100644
--- a/engines/pink/objects/actors/inventory_actor.h
+++ b/engines/pink/objects/actors/inventory_actor.h
@@ -33,7 +33,7 @@ namespace Pink {
class InventoryActor : public Actor {
public:
void toConsole() override {
- debug("InventoryActor: _name = %s", _name.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "InventoryActor: _name = %s", _name.c_str());
for (uint i = 0; i < _actions.size(); ++i) {
_actions[i]->toConsole();
}
diff --git a/engines/pink/objects/actors/lead_actor.cpp b/engines/pink/objects/actors/lead_actor.cpp
index 216797842e..b5fd04779c 100644
--- a/engines/pink/objects/actors/lead_actor.cpp
+++ b/engines/pink/objects/actors/lead_actor.cpp
@@ -48,7 +48,7 @@ void LeadActor::deserialize(Archive &archive) {
}
void LeadActor::toConsole() {
- debug("LeadActor: _name = %s", _name.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "LeadActor: _name = %s", _name.c_str());
for (uint i = 0; i < _actions.size(); ++i) {
_actions[i]->toConsole();
}
@@ -440,7 +440,7 @@ Actor *LeadActor::findActor(const Common::String &name) {
}
void ParlSqPink::toConsole() {
- debug("ParlSqPink: _name = %s", _name.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "ParlSqPink: _name = %s", _name.c_str());
for (uint i = 0; i < _actions.size(); ++i) {
_actions[i]->toConsole();
}
@@ -454,7 +454,7 @@ WalkLocation *ParlSqPink::getWalkDestination() {
}
void PubPink::toConsole() {
- debug("PubPink: _name = %s", _name.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "PubPink: _name = %s", _name.c_str());
for (uint i = 0; i < _actions.size(); ++i) {
_actions[i]->toConsole();
}
diff --git a/engines/pink/objects/actors/pda_button_actor.cpp b/engines/pink/objects/actors/pda_button_actor.cpp
index f919702097..647f426468 100644
--- a/engines/pink/objects/actors/pda_button_actor.cpp
+++ b/engines/pink/objects/actors/pda_button_actor.cpp
@@ -57,7 +57,7 @@ void PDAButtonActor::deserialize(Archive &archive) {
}
void PDAButtonActor::toConsole() {
- debug("PDAButtonActor: _name = %s, _x = %u _y = %u _hideOnStop = %u, _opaque = %u, _commandType = %u, _arg = %s",
+ debugC(6, kPinkDebugLoadingObjects, "PDAButtonActor: _name = %s, _x = %u _y = %u _hideOnStop = %u, _opaque = %u, _commandType = %u, _arg = %s",
_name.c_str(), _x, _y, _hideOnStop, _opaque, (int)_command.type, _command.arg.c_str());
}
diff --git a/engines/pink/objects/actors/supporting_actor.cpp b/engines/pink/objects/actors/supporting_actor.cpp
index b158650caa..d6310c9b6a 100644
--- a/engines/pink/objects/actors/supporting_actor.cpp
+++ b/engines/pink/objects/actors/supporting_actor.cpp
@@ -20,6 +20,7 @@
*
*/
+#include "pink/pink.h"
#include "pink/utils.h"
#include "pink/constants.h"
#include "pink/cursor_mgr.h"
@@ -38,7 +39,7 @@ void SupportingActor::deserialize(Archive &archive) {
}
void SupportingActor::toConsole() {
- debug("SupportingActor: _name = %s, _location=%s, _pdaLink=%s, _cursor=%s",
+ debugC(6, kPinkDebugLoadingObjects, "SupportingActor: _name = %s, _location=%s, _pdaLink=%s, _cursor=%s",
_name.c_str(), _location.c_str(), _pdaLink.c_str(), _cursor.c_str());
for (uint i = 0; i < _actions.size(); ++i) {
_actions[i]->toConsole();
diff --git a/engines/pink/objects/condition.cpp b/engines/pink/objects/condition.cpp
index 1329556df6..f20c25e249 100644
--- a/engines/pink/objects/condition.cpp
+++ b/engines/pink/objects/condition.cpp
@@ -38,7 +38,7 @@ bool Pink::ConditionGameVariable::evaluate(Actor *actor) {
}
void ConditionGameVariable::toConsole() {
- debug("\t\tConditionGameVariable: _name=%s, _value=%s", _name.c_str(), _value.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\t\tConditionGameVariable: _name=%s, _value=%s", _name.c_str(), _value.c_str());
}
bool Pink::ConditionModuleVariable::evaluate(Actor *actor) {
@@ -46,7 +46,7 @@ bool Pink::ConditionModuleVariable::evaluate(Actor *actor) {
}
void ConditionModuleVariable::toConsole() {
- debug("\t\tConditionModuleVariable: _name=%s, _value=%s", _name.c_str(), _value.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\t\tConditionModuleVariable: _name=%s, _value=%s", _name.c_str(), _value.c_str());
}
bool Pink::ConditionNotModuleVariable::evaluate(Actor *actor) {
@@ -54,7 +54,7 @@ bool Pink::ConditionNotModuleVariable::evaluate(Actor *actor) {
}
void ConditionNotModuleVariable::toConsole() {
- debug("\t\tConditionNotModuleVariable: _name=%s, _value=%s", _name.c_str(), _value.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\t\tConditionNotModuleVariable: _name=%s, _value=%s", _name.c_str(), _value.c_str());
}
bool ConditionPageVariable::evaluate(Actor *actor) {
@@ -62,7 +62,7 @@ bool ConditionPageVariable::evaluate(Actor *actor) {
}
void ConditionPageVariable::toConsole() {
- debug("\t\tConditionPageVariable: _name=%s, _value=%s", _name.c_str(), _value.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\t\tConditionPageVariable: _name=%s, _value=%s", _name.c_str(), _value.c_str());
}
bool ConditionNotPageVariable::evaluate(Actor *actor) {
@@ -70,7 +70,7 @@ bool ConditionNotPageVariable::evaluate(Actor *actor) {
}
void ConditionNotPageVariable::toConsole() {
- debug("\t\tConditionNotPageVariable: _name=%s, _value=%s", _name.c_str(), _value.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\t\tConditionNotPageVariable: _name=%s, _value=%s", _name.c_str(), _value.c_str());
}
void ConditionInventoryItemOwner::deserialize(Archive &archive) {
@@ -85,7 +85,7 @@ bool ConditionInventoryItemOwner::evaluate(Actor *actor) {
}
void ConditionInventoryItemOwner::toConsole() {
- debug("\t\tConditionInventoryItemOwner: _item=%s, _owner=%s", _item.c_str(), _owner.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\t\tConditionInventoryItemOwner: _item=%s, _owner=%s", _item.c_str(), _owner.c_str());
}
bool ConditionNotInventoryItemOwner::evaluate(Actor *actor) {
@@ -93,7 +93,7 @@ bool ConditionNotInventoryItemOwner::evaluate(Actor *actor) {
}
void ConditionNotInventoryItemOwner::toConsole() {
- debug("\t\tConditionNotInventoryItemOwner: _item=%s, _owner=%s", _item.c_str(), _owner.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\t\tConditionNotInventoryItemOwner: _item=%s, _owner=%s", _item.c_str(), _owner.c_str());
}
} // End of namespace Pink
diff --git a/engines/pink/objects/handlers/handler.cpp b/engines/pink/objects/handlers/handler.cpp
index 1c9cc4bbed..4a3c91ebcd 100644
--- a/engines/pink/objects/handlers/handler.cpp
+++ b/engines/pink/objects/handlers/handler.cpp
@@ -91,40 +91,40 @@ void HandlerStartPage::execute(Sequence *sequence) {
}
void HandlerStartPage::toConsole() {
- debug("HandlerStartPage:");
+ debugC(6, kPinkDebugLoadingObjects, "HandlerStartPage:");
- debug("\tSideEffects:");
+ debugC(6, kPinkDebugLoadingObjects, "\tSideEffects:");
for (uint i = 0; i < _sideEffects.size(); ++i) {
_sideEffects[i]->toConsole();
}
- debug("\tConditions:");
+ debugC(6, kPinkDebugLoadingObjects, "\tConditions:");
for (uint i = 0; i < _conditions.size(); ++i) {
_conditions[i]->toConsole();
}
- debug("\tSequences:");
+ debugC(6, kPinkDebugLoadingObjects, "\tSequences:");
for (uint i = 0; i < _sequences.size(); ++i) {
- debug("\t\t%s", _sequences[i].c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\t\t%s", _sequences[i].c_str());
}
}
void HandlerLeftClick::toConsole() {
- debug("HandlerLeftClick:");
+ debugC(6, kPinkDebugLoadingObjects, "HandlerLeftClick:");
- debug("\tSideEffects:");
+ debugC(6, kPinkDebugLoadingObjects, "\tSideEffects:");
for (uint i = 0; i < _sideEffects.size(); ++i) {
_sideEffects[i]->toConsole();
}
- debug("\tConditions:");
+ debugC(6, kPinkDebugLoadingObjects, "\tConditions:");
for (uint i = 0; i < _conditions.size(); ++i) {
_conditions[i]->toConsole();
}
- debug("\tSequences:");
+ debugC(6, kPinkDebugLoadingObjects, "\tSequences:");
for (uint i = 0; i < _sequences.size(); ++i) {
- debug("\t\t%s", _sequences[i].c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\t\t%s", _sequences[i].c_str());
}
}
@@ -135,20 +135,20 @@ void HandlerUseClick::deserialize(Archive &archive) {
}
void HandlerUseClick::toConsole() {
- debug("HandlerUseClick: _inventoryItem=%s, _recepient=%s", _inventoryItem.c_str(), _recepient.c_str());
- debug("\tSideEffects:");
+ debugC(6, kPinkDebugLoadingObjects, "HandlerUseClick: _inventoryItem=%s, _recepient=%s", _inventoryItem.c_str(), _recepient.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\tSideEffects:");
for (uint i = 0; i < _sideEffects.size(); ++i) {
_sideEffects[i]->toConsole();
}
- debug("\tConditions:");
+ debugC(6, kPinkDebugLoadingObjects, "\tConditions:");
for (uint i = 0; i < _conditions.size(); ++i) {
_conditions[i]->toConsole();
}
- debug("\tSequences:");
+ debugC(6, kPinkDebugLoadingObjects, "\tSequences:");
for (uint i = 0; i < _sequences.size(); ++i) {
- debug("\t\t%s", _sequences[i].c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\t\t%s", _sequences[i].c_str());
}
}
diff --git a/engines/pink/objects/handlers/handler_mgr.cpp b/engines/pink/objects/handlers/handler_mgr.cpp
index de6809d165..bd71952e82 100644
--- a/engines/pink/objects/handlers/handler_mgr.cpp
+++ b/engines/pink/objects/handlers/handler_mgr.cpp
@@ -21,6 +21,7 @@
*/
#include "pink/archive.h"
+#include "pink/pink.h"
#include "pink/objects/inventory.h"
#include "pink/objects/handlers/handler.h"
#include "pink/objects/handlers/handler_mgr.h"
@@ -34,7 +35,7 @@ void HandlerMgr::deserialize(Archive &archive) {
}
void HandlerMgr::toConsole() {
- debug("HandlerMgr:");
+ debugC(6, kPinkDebugLoadingObjects, "HandlerMgr:");
for (uint i = 0; i < _leftClickHandlers.size(); ++i) {
_leftClickHandlers[i]->toConsole();
}
diff --git a/engines/pink/objects/handlers/handler_timer.cpp b/engines/pink/objects/handlers/handler_timer.cpp
index 308759451f..3a4f7a9db7 100644
--- a/engines/pink/objects/handlers/handler_timer.cpp
+++ b/engines/pink/objects/handlers/handler_timer.cpp
@@ -40,21 +40,21 @@ void HandlerTimerActions::deserialize(Archive &archive) {
}
void HandlerTimerActions::toConsole() {
- debug("HandlerTimerActions:");
+ debugC(6, kPinkDebugLoadingObjects, "HandlerTimerActions:");
- debug("\tSideEffects:");
+ debugC(6, kPinkDebugLoadingObjects, "\tSideEffects:");
for (uint i = 0; i < _sideEffects.size(); ++i) {
_sideEffects[i]->toConsole();
}
- debug("\tConditions:");
+ debugC(6, kPinkDebugLoadingObjects, "\tConditions:");
for (uint i = 0; i < _conditions.size(); ++i) {
_conditions[i]->toConsole();
}
- debug("\tActions:");
+ debugC(6, kPinkDebugLoadingObjects, "\tActions:");
for (uint i = 0; i < _actions.size(); ++i) {
- debug("\t\t%s", _actions[i].c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\t\t%s", _actions[i].c_str());
}
}
@@ -69,27 +69,22 @@ void HandlerTimerActions::handle(Actor *actor) {
}
}
-
-void HandlerTimerSequences::execute(Sequence *sequence) {
- error("HandlerTimerSequences function is not implemented");
-}
-
void HandlerTimerSequences::toConsole() {
- debug("HandlerTimerSequences:");
+ debugC(6, kPinkDebugLoadingObjects, "HandlerTimerSequences:");
- debug("\tSideEffects:");
+ debugC(6, kPinkDebugLoadingObjects, "\tSideEffects:");
for (uint i = 0; i < _sideEffects.size(); ++i) {
_sideEffects[i]->toConsole();
}
- debug("\tConditions:");
+ debugC(6, kPinkDebugLoadingObjects, "\tConditions:");
for (uint i = 0; i < _conditions.size(); ++i) {
_conditions[i]->toConsole();
}
- debug("\tSequences:");
+ debugC(6, kPinkDebugLoadingObjects, "\tSequences:");
for (uint i = 0; i < _sequences.size(); ++i) {
- debug("\t\t%s", _sequences[i].c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\t\t%s", _sequences[i].c_str());
}
}
diff --git a/engines/pink/objects/handlers/handler_timer.h b/engines/pink/objects/handlers/handler_timer.h
index b420272c2a..9ea00b1b10 100644
--- a/engines/pink/objects/handlers/handler_timer.h
+++ b/engines/pink/objects/handlers/handler_timer.h
@@ -55,7 +55,7 @@ public:
virtual void handle(Actor *actor);
protected:
- virtual void execute(Sequence *sequence);
+ virtual void execute(Sequence *sequence) {};
};
} // End of namespace Pink
diff --git a/engines/pink/objects/inventory.cpp b/engines/pink/objects/inventory.cpp
index ff685d1573..cdbed307e4 100644
--- a/engines/pink/objects/inventory.cpp
+++ b/engines/pink/objects/inventory.cpp
@@ -44,7 +44,7 @@ void InventoryItem::deserialize(Archive &archive) {
}
void InventoryItem::toConsole() {
- debug("\tInventoryItem: _initialOwner=%s _currentOwner=%s", _initialOwner.c_str(), _currentOwner.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\tInventoryItem: _initialOwner=%s _currentOwner=%s", _initialOwner.c_str(), _currentOwner.c_str());
}
InventoryMgr::~InventoryMgr() {
@@ -67,7 +67,7 @@ InventoryItem *InventoryMgr::findInventoryItem(const Common::String &name) {
}
void InventoryMgr::toConsole() {
- debug("InventoryMgr:");
+ debugC(6, kPinkDebugLoadingObjects, "InventoryMgr:");
for (uint i = 0; i < _items.size(); ++i) {
_items[i]->toConsole();
}
diff --git a/engines/pink/objects/pages/game_page.cpp b/engines/pink/objects/pages/game_page.cpp
index a45fca7b7f..012b54721c 100644
--- a/engines/pink/objects/pages/game_page.cpp
+++ b/engines/pink/objects/pages/game_page.cpp
@@ -55,7 +55,7 @@ void GamePage::deserialize(Archive &archive) {
}
void GamePage::load(Archive &archive) {
- debug("GamePage load started");
+ debugC(6, kPinkDebugLoadingObjects, "GamePage load");
archive.mapObject(_cursorMgr);
archive.mapObject(_walkMgr);
archive.mapObject(_sequencer);
@@ -67,7 +67,6 @@ void GamePage::load(Archive &archive) {
_walkMgr->deserialize(archive);
_sequencer->deserialize(archive);
_handlers.deserialize(archive);
- debug("GamePage load ended");
}
void GamePage::init(bool isLoadingSave) {
@@ -108,7 +107,7 @@ void GamePage::loadManagers() {
_walkMgr = new WalkMgr;
_sequencer = new Sequencer(this);
- debug("ResMgr init");
+ debugC(6, kPinkDebugGeneral, "ResMgr init");
_resMgr.init(_module->getGame(), this);
if (_memFile != nullptr) {
diff --git a/engines/pink/objects/pages/page.cpp b/engines/pink/objects/pages/page.cpp
index 38165719bc..337f65ef0e 100644
--- a/engines/pink/objects/pages/page.cpp
+++ b/engines/pink/objects/pages/page.cpp
@@ -32,7 +32,7 @@ Page::~Page() {
}
void Page::load(Archive &archive) {
- debug("Page load");
+ debugC(6, kPinkDebugLoadingObjects, "Page load");
archive.mapObject(this);
NamedObject::deserialize(archive);
archive.readString(); //skip directory
diff --git a/engines/pink/objects/sequences/seq_timer.cpp b/engines/pink/objects/sequences/seq_timer.cpp
index 5342dbff4a..6ea5e5bf20 100644
--- a/engines/pink/objects/sequences/seq_timer.cpp
+++ b/engines/pink/objects/sequences/seq_timer.cpp
@@ -43,7 +43,7 @@ void SeqTimer::deserialize(Archive &archive) {
}
void SeqTimer::toConsole() {
- debug("\tSeqTimer: _actor=%s _period=%u _range=%u", _actor.c_str(), _period, _range);
+ debugC(6, kPinkDebugLoadingObjects, "\tSeqTimer: _actor=%s _period=%u _range=%u", _actor.c_str(), _period, _range);
}
void SeqTimer::update() {
diff --git a/engines/pink/objects/sequences/sequence.cpp b/engines/pink/objects/sequences/sequence.cpp
index 5d303fbd65..44bfbf9c63 100644
--- a/engines/pink/objects/sequences/sequence.cpp
+++ b/engines/pink/objects/sequences/sequence.cpp
@@ -23,6 +23,7 @@
#include "common/debug.h"
#include "pink/archive.h"
+#include "pink/pink.h"
#include "pink/sound.h"
#include "pink/objects/actors/actor.h"
#include "pink/objects/pages/game_page.h"
@@ -49,8 +50,8 @@ void Sequence::deserialize(Archive &archive) {
}
void Sequence::toConsole() {
- debug("\t\tSequence %s", _name.c_str());
- debug("\t\t\tItems:");
+ debugC(6, kPinkDebugLoadingObjects, "\t\tSequence %s", _name.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\t\t\tItems:");
for (uint i = 0; i < _items.size(); ++i) {
_items[i]->toConsole();
}
@@ -60,7 +61,7 @@ void Sequence::start(bool loadingSave) {
uint nextItemIndex = _context->getNextItemIndex();
if (nextItemIndex >= _items.size() ||
!_items[nextItemIndex]->execute(_context->getSegment(), this, loadingSave)) {
- debug("Sequence %s ended", _name.c_str());
+ debugC(6, kPinkDebugScripts, "Sequence %s ended", _name.c_str());
end();
return;
}
@@ -78,7 +79,7 @@ void Sequence::start(bool loadingSave) {
void Sequence::update() {
if (!_context->getActor()->isPlaying()) {
- debug("Sequence step ended");
+ debugC(6, kPinkDebugScripts, "SubSequence of %s Sequence ended", _name.c_str());
start(0);
}
}
@@ -132,8 +133,8 @@ void SequenceAudio::deserialize(Archive &archive) {
}
void SequenceAudio::toConsole() {
- debug("\t\tSequenceAudio %s : _sound = %s", _name.c_str(), _soundName.c_str());
- debug("\t\t\tItems:");
+ debugC(6, kPinkDebugLoadingObjects, "\t\tSequenceAudio %s : _sound = %s", _name.c_str(), _soundName.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\t\t\tItems:");
for (uint i = 0; i < _items.size(); ++i) {
_items[i]->toConsole();
}
diff --git a/engines/pink/objects/sequences/sequence_context.cpp b/engines/pink/objects/sequences/sequence_context.cpp
index 962aeb2814..ff7d4e8dab 100644
--- a/engines/pink/objects/sequences/sequence_context.cpp
+++ b/engines/pink/objects/sequences/sequence_context.cpp
@@ -22,6 +22,7 @@
#include "common/debug.h"
+#include "pink/pink.h"
#include "pink/objects/actors/actor.h"
#include "pink/objects/pages/game_page.h"
#include "pink/objects/sequences/sequence.h"
@@ -46,7 +47,7 @@ SequenceContext::SequenceContext(Sequence *sequence)
{
sequence->setContext(this);
Common::Array<SequenceItem *> &items = sequence->getItems();
- debug("SequenceContext for %s", _sequence->getName().c_str());
+ debug(kPinkDebugScripts, "SequenceContext for %s", _sequence->getName().c_str());
for (uint i = 0; i < items.size(); ++i) {
bool found = 0;
@@ -57,7 +58,7 @@ SequenceContext::SequenceContext(Sequence *sequence)
}
}
if (!found) {
- debug("%s", items[i]->getActor().c_str());
+ debug(kPinkDebugScripts, "%s", items[i]->getActor().c_str());
_states.push_back(SequenceActorState(items[i]->getActor()));
}
}
diff --git a/engines/pink/objects/sequences/sequence_item.cpp b/engines/pink/objects/sequences/sequence_item.cpp
index 15a39f183c..ec8bc711a0 100644
--- a/engines/pink/objects/sequences/sequence_item.cpp
+++ b/engines/pink/objects/sequences/sequence_item.cpp
@@ -23,6 +23,7 @@
#include "common/debug.h"
#include "pink/archive.h"
+#include "pink/pink.h"
#include "pink/objects/actions/action.h"
#include "pink/objects/actors/actor.h"
#include "pink/objects/pages/game_page.h"
@@ -39,7 +40,7 @@ void SequenceItem::deserialize(Archive &archive) {
}
void SequenceItem::toConsole() {
- debug("\t\t\t\tSequenceItem: _actor=%s, _action=%s", _actor.c_str(), _action.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\t\t\t\tSequenceItem: _actor=%s, _action=%s", _actor.c_str(), _action.c_str());
}
bool SequenceItem::execute(uint segment, Sequence *sequence, bool loadingSave) {
@@ -68,7 +69,7 @@ bool SequenceItemLeader::isLeader() {
}
void SequenceItemLeader::toConsole() {
- debug("\t\t\t\tSequenceItemLeader: _actor=%s, _action=%s", _actor.c_str(), _action.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\t\t\t\tSequenceItemLeader: _actor=%s, _action=%s", _actor.c_str(), _action.c_str());
}
@@ -78,7 +79,7 @@ void SequenceItemLeaderAudio::deserialize(Archive &archive) {
}
void SequenceItemLeaderAudio::toConsole() {
- debug("\t\t\t\tSequenceItemLeaderAudio: _actor=%s, _action=%s _sample=%d", _actor.c_str(), _action.c_str(), _sample);
+ debugC(6, kPinkDebugLoadingObjects, "\t\t\t\tSequenceItemLeaderAudio: _actor=%s, _action=%s _sample=%d", _actor.c_str(), _action.c_str(), _sample);
}
bool SequenceItemDefaultAction::execute(uint segment, Sequence *sequence, bool loadingSave) {
@@ -89,7 +90,7 @@ bool SequenceItemDefaultAction::execute(uint segment, Sequence *sequence, bool l
}
void SequenceItemDefaultAction::toConsole() {
- debug("\t\t\t\tSequenceItemDefaultAction: _actor=%s, _action=%s", _actor.c_str(), _action.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\t\t\t\tSequenceItemDefaultAction: _actor=%s, _action=%s", _actor.c_str(), _action.c_str());
}
void SequenceItemDefaultAction::skip(Sequence *sequence) {
diff --git a/engines/pink/objects/sequences/sequencer.cpp b/engines/pink/objects/sequences/sequencer.cpp
index f76ed66ab4..8885fdc213 100644
--- a/engines/pink/objects/sequences/sequencer.cpp
+++ b/engines/pink/objects/sequences/sequencer.cpp
@@ -68,38 +68,39 @@ void Sequencer::authorSequence(Sequence *sequence, bool loadingSave) {
if (sequence) {
SequenceContext *context = new SequenceContext(sequence);
-
SequenceContext *confilct;
while((confilct = findConfilictingContextWith(context)) != nullptr)
confilct->getSequence()->forceEnd();
_context = context;
sequence->init(loadingSave);
+ debugC(5, kPinkDebugScripts, "Main Sequence %s started", sequence->getName().c_str());
}
}
-void Sequencer::authorParallelSequence(Sequence *seqeunce, bool loadingSave) {
- if (_context && _context->getSequence() == seqeunce)
+void Sequencer::authorParallelSequence(Sequence *sequence, bool loadingSave) {
+ if (_context && _context->getSequence() == sequence)
return;
for (uint i = 0; i < _parrallelContexts.size(); ++i) {
- if (_parrallelContexts[i]->getSequence() == seqeunce)
+ if (_parrallelContexts[i]->getSequence() == sequence)
return;
}
const Common::String leadName = _page->getLeadActor()->getName();
- SequenceContext *context = new SequenceContext(seqeunce);
+ SequenceContext *context = new SequenceContext(sequence);
if (!context->findState(leadName) && !findConfilictingContextWith(context)) {
_parrallelContexts.push_back(context);
- seqeunce->init(loadingSave);
+ sequence->init(loadingSave);
+ debugC(6, kPinkDebugScripts, "Parallel Sequence %s started", sequence->getName().c_str());
} else
delete context;
}
void Sequencer::toConsole() {
- debug("Sequencer:");
+ debugC(6, kPinkDebugLoadingObjects, "Sequencer:");
for (uint i = 0; i < _sequences.size(); ++i) {
_sequences[i]->toConsole();
}
diff --git a/engines/pink/objects/side_effect.cpp b/engines/pink/objects/side_effect.cpp
index ff9e14db14..1086e4740b 100644
--- a/engines/pink/objects/side_effect.cpp
+++ b/engines/pink/objects/side_effect.cpp
@@ -42,7 +42,7 @@ void SideEffectExit::execute(Actor *actor) {
}
void SideEffectExit::toConsole() {
- debug("\t\tSideEffectExit: _nextModule=%s, _nextPage=%s", _nextModule.c_str(), _nextPage.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\t\tSideEffectExit: _nextModule=%s, _nextPage=%s", _nextModule.c_str(), _nextPage.c_str());
}
void SideEffectLocation::deserialize(Archive &archive) {
@@ -57,7 +57,7 @@ void SideEffectLocation::execute(Actor *actor) {
}
void SideEffectLocation::toConsole() {
- debug("\t\tSideEffectLocation: _location=%s", _location.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\t\tSideEffectLocation: _location=%s", _location.c_str());
}
void SideEffectInventoryItemOwner::deserialize(Archive &archive) {
@@ -72,7 +72,7 @@ void SideEffectInventoryItemOwner::execute(Actor *actor) {
}
void SideEffectInventoryItemOwner::toConsole() {
- debug("\t\tSideEffectInventoryItemOwner: _item=%s, _owner=%s", _item.c_str(), _owner.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\t\tSideEffectInventoryItemOwner: _item=%s, _owner=%s", _item.c_str(), _owner.c_str());
}
void SideEffectVariable::deserialize(Pink::Archive &archive) {
@@ -85,7 +85,7 @@ void SideEffectGameVariable::execute(Actor *actor) {
}
void SideEffectGameVariable::toConsole() {
- debug("\t\tSideEffectGameVariable: _name=%s, _value=%s", _name.c_str(), _value.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\t\tSideEffectGameVariable: _name=%s, _value=%s", _name.c_str(), _value.c_str());
}
void SideEffectModuleVariable::execute(Actor *actor) {
@@ -93,7 +93,7 @@ void SideEffectModuleVariable::execute(Actor *actor) {
}
void SideEffectModuleVariable::toConsole() {
- debug("\t\tSideEffectModuleVariable: _name=%s, _value=%s", _name.c_str(), _value.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\t\tSideEffectModuleVariable: _name=%s, _value=%s", _name.c_str(), _value.c_str());
}
void SideEffectPageVariable::execute(Actor *actor) {
@@ -101,7 +101,7 @@ void SideEffectPageVariable::execute(Actor *actor) {
}
void SideEffectPageVariable::toConsole() {
- debug("\t\tSideEffectPageVariable: _name=%s, _value=%s", _name.c_str(), _value.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\t\tSideEffectPageVariable: _name=%s, _value=%s", _name.c_str(), _value.c_str());
}
void SideEffectRandomPageVariable::deserialize(Archive &archive) {
@@ -125,7 +125,7 @@ void SideEffectRandomPageVariable::toConsole() {
values += ',';
}
values += '}';
- debug("\t\tSideEffectRandomPageVariable: _name=%s, _values=%s", _name.c_str(), values.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\t\tSideEffectRandomPageVariable: _name=%s, _values=%s", _name.c_str(), values.c_str());
}
} // End of namespace Pink
diff --git a/engines/pink/objects/walk/walk_location.cpp b/engines/pink/objects/walk/walk_location.cpp
index dd16882396..83ffe8dd2c 100644
--- a/engines/pink/objects/walk/walk_location.cpp
+++ b/engines/pink/objects/walk/walk_location.cpp
@@ -23,6 +23,7 @@
#include "common/debug.h"
#include "pink/archive.h"
+#include "pink/pink.h"
#include "pink/objects/walk/walk_location.h"
namespace Pink {
@@ -33,10 +34,10 @@ void WalkLocation::deserialize(Pink::Archive &archive) {
}
void WalkLocation::toConsole() {
- debug("\tWalkLocation: _name =%s", _name.c_str());
- debug("\tNeighbors:");
+ debugC(6, kPinkDebugLoadingObjects, "\tWalkLocation: _name =%s", _name.c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\tNeighbors:");
for (uint i = 0; i < _neighbors.size(); ++i) {
- debug("\t\t%s", _neighbors[i].c_str());
+ debugC(6, kPinkDebugLoadingObjects, "\t\t%s", _neighbors[i].c_str());
}
}
diff --git a/engines/pink/objects/walk/walk_mgr.cpp b/engines/pink/objects/walk/walk_mgr.cpp
index 21e8392875..ab221921bc 100644
--- a/engines/pink/objects/walk/walk_mgr.cpp
+++ b/engines/pink/objects/walk/walk_mgr.cpp
@@ -22,6 +22,7 @@
#include "pink/archive.h"
#include "pink/cel_decoder.h"
+#include "pink/pink.h"
#include "pink/objects/actions/walk_action.h"
#include "pink/objects/actors/lead_actor.h"
#include "pink/objects/walk/walk_location.h"
@@ -52,7 +53,7 @@ WalkLocation *WalkMgr::findLocation(const Common::String &name) {
}
void WalkMgr::toConsole() {
- debug("WalkMgr:");
+ debugC(6, kPinkDebugLoadingObjects, "WalkMgr:");
for (uint i = 0; i < _locations.size(); ++i) {
_locations[i]->toConsole();
}
diff --git a/engines/pink/pink.cpp b/engines/pink/pink.cpp
index 4f7e84f595..18e1dcb6c0 100644
--- a/engines/pink/pink.cpp
+++ b/engines/pink/pink.cpp
@@ -42,13 +42,12 @@ PinkEngine::PinkEngine(OSystem *system, const ADGameDescription *desc)
: Engine(system), _console(nullptr), _rnd("pink"),
_desc(*desc), _bro(nullptr), _actor(nullptr),
_module(nullptr), _director(nullptr), _pdaMgr(this) {
- debug("PinkEngine constructed");
DebugMan.addDebugChannel(kPinkDebugGeneral, "general", "General issues");
- DebugMan.addDebugChannel(kPinkDebugLoadingObjects, "loading_objects", "Serializing objects from Orb");
DebugMan.addDebugChannel(kPinkDebugLoadingResources, "loading_resources", "Loading resources data");
- DebugMan.addDebugChannel(kPinkDebugGraphics, "graphics", "Graphics handling");
- DebugMan.addDebugChannel(kPinkDebugSound, "sound", "Sound processing");
+ DebugMan.addDebugChannel(kPinkDebugLoadingObjects, "loading_objects", "Serializing objects from Orb");
+ DebugMan.addDebugChannel(kPinkDebugScripts, "scripts", "Sequences");
+ DebugMan.addDebugChannel(kPinkDebugActions, "actions", "Actions");
const Common::FSNode gameDataDir(ConfMan.get("path"));
SearchMan.addSubDirectoryMatching(gameDataDir, "install");
@@ -68,8 +67,7 @@ PinkEngine::~PinkEngine() {
}
Common::Error PinkEngine::init() {
- debug("PinkEngine init");
-
+ debugC(10, kPinkDebugGeneral, "PinkEngine init");
initGraphics(640, 480);
Common::PEResources exeResources;
@@ -101,7 +99,7 @@ Common::Error PinkEngine::init() {
setCursor(kLoadingCursor);
_orb.loadGame(this);
- debug("Modules are loaded");
+ debugC(6, kPinkDebugGeneral, "Modules are loaded");
syncSoundSettings();
@@ -184,7 +182,7 @@ void PinkEngine::initModule(const Common::String &moduleName, const Common::Stri
if (saveFile)
_module->loadState(*saveFile);
- debug("Module added");
+ debugC(6, kPinkDebugGeneral, "Module added");
_module->init(saveFile ? kLoadingSave : kLoadingNewGame, pageName);
}
diff --git a/engines/pink/pink.h b/engines/pink/pink.h
index ac70e1bca7..da7ac49bc8 100644
--- a/engines/pink/pink.h
+++ b/engines/pink/pink.h
@@ -73,8 +73,8 @@ enum {
kPinkDebugGeneral = 1 << 0,
kPinkDebugLoadingResources = 1 << 1,
kPinkDebugLoadingObjects = 1 << 2,
- kPinkDebugGraphics = 1 << 3,
- kPinkDebugSound = 1 << 4
+ kPinkDebugScripts = 1 << 3,
+ kPinkDebugActions = 1 << 4
};
class PinkEngine : public Engine {
diff --git a/engines/pink/resource_mgr.cpp b/engines/pink/resource_mgr.cpp
index f9a24816be..52f92839d6 100644
--- a/engines/pink/resource_mgr.cpp
+++ b/engines/pink/resource_mgr.cpp
@@ -46,6 +46,8 @@ void ResourceMgr::init(PinkEngine *game, Page *page) {
_resCount = objDesc->resourcesCount;
orb->loadObject(page, objDesc);
_resDescTable = orb->createResDescTable(objDesc);
+
+ debugC(kPinkDebugLoadingResources, "%d Resource descriptions are loaded", _resCount);
}
void ResourceMgr::clear() {
@@ -77,6 +79,7 @@ Common::SafeSeekableSubReadStream *ResourceMgr::getResourceStream(const Common::
stream->seek(desc->offset);
+ debugC(kPinkDebugLoadingResources, "Got stream of %s resource", name.c_str());
return new Common::SafeSeekableSubReadStream(stream, desc->offset,
desc->offset + desc->size);
}