diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/pink/objects/actions/action_hide.cpp | 4 | ||||
-rw-r--r-- | engines/pink/objects/actions/action_loop.cpp | 5 | ||||
-rw-r--r-- | engines/pink/objects/actions/action_loop.h | 2 | ||||
-rw-r--r-- | engines/pink/objects/actions/action_play.cpp | 4 | ||||
-rw-r--r-- | engines/pink/objects/actions/action_play_with_sfx.cpp | 6 | ||||
-rw-r--r-- | engines/pink/objects/actions/action_play_with_sfx.h | 2 | ||||
-rw-r--r-- | engines/pink/objects/actions/action_sound.cpp | 4 | ||||
-rw-r--r-- | engines/pink/objects/actions/action_still.cpp | 4 | ||||
-rw-r--r-- | engines/pink/objects/sequences/sequence.cpp | 4 | ||||
-rw-r--r-- | engines/pink/objects/sequences/sequence_context.cpp | 4 | ||||
-rw-r--r-- | engines/pink/objects/sequences/sequencer.cpp | 13 | ||||
-rw-r--r-- | engines/pink/pink.cpp | 7 | ||||
-rw-r--r-- | engines/pink/pink.h | 4 | ||||
-rw-r--r-- | engines/pink/resource_mgr.cpp | 3 |
14 files changed, 42 insertions, 24 deletions
diff --git a/engines/pink/objects/actions/action_hide.cpp b/engines/pink/objects/actions/action_hide.cpp index 6eeba8afaa..10c41c247e 100644 --- a/engines/pink/objects/actions/action_hide.cpp +++ b/engines/pink/objects/actions/action_hide.cpp @@ -32,12 +32,12 @@ void ActionHide::toConsole() { } void ActionHide::start() { - debugC(6, kPinkDebugGeneral, "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() { - debugC(6, kPinkDebugGeneral, "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 42caef3a4a..c8ef5da9d9 100644 --- a/engines/pink/objects/actions/action_loop.cpp +++ b/engines/pink/objects/actions/action_loop.cpp @@ -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 dccfade9bd..fb4f05f0cb 100644 --- a/engines/pink/objects/actions/action_play.cpp +++ b/engines/pink/objects/actions/action_play.cpp @@ -42,7 +42,7 @@ void ActionPlay::toConsole() { void ActionPlay::end() { ActionCEL::end(); - debugC(6, kPinkDebugGeneral, "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() { @@ -60,7 +60,7 @@ void ActionPlay::pause(bool paused) { } void ActionPlay::onStart() { - debugC(6, kPinkDebugGeneral, "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 328bca0b37..0c8aa94c2c 100644 --- a/engines/pink/objects/actions/action_play_with_sfx.cpp +++ b/engines/pink/objects/actions/action_play_with_sfx.cpp @@ -71,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(); @@ -86,6 +91,7 @@ void ActionSfx::toConsole() { 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 6491c09d01..4d4918f0f1 100644 --- a/engines/pink/objects/actions/action_sound.cpp +++ b/engines/pink/objects/actions/action_sound.cpp @@ -62,7 +62,7 @@ void ActionSound::start() { _sound.play(page->getResourceStream(_fileName), soundType, _volume, 0, _isLoop); - debugC(6, kPinkDebugGeneral, "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); } - debugC(6, kPinkDebugGeneral, "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 33bb324a37..715051542f 100644 --- a/engines/pink/objects/actions/action_still.cpp +++ b/engines/pink/objects/actions/action_still.cpp @@ -42,13 +42,13 @@ void ActionStill::toConsole() { void ActionStill::end() { ActionCEL::end(); - debugC(6, kPinkDebugGeneral, "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() { - debugC(6, kPinkDebugGeneral, "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/sequences/sequence.cpp b/engines/pink/objects/sequences/sequence.cpp index 9afeb8b48f..44bfbf9c63 100644 --- a/engines/pink/objects/sequences/sequence.cpp +++ b/engines/pink/objects/sequences/sequence.cpp @@ -61,7 +61,7 @@ void Sequence::start(bool loadingSave) { uint nextItemIndex = _context->getNextItemIndex(); if (nextItemIndex >= _items.size() || !_items[nextItemIndex]->execute(_context->getSegment(), this, loadingSave)) { - debugC(6, kPinkDebugGeneral, "Sequence %s ended", _name.c_str()); + debugC(6, kPinkDebugScripts, "Sequence %s ended", _name.c_str()); end(); return; } @@ -79,7 +79,7 @@ void Sequence::start(bool loadingSave) { void Sequence::update() { if (!_context->getActor()->isPlaying()) { - debugC(6, kPinkDebugGeneral, "Sequence step ended"); + debugC(6, kPinkDebugScripts, "SubSequence of %s Sequence ended", _name.c_str()); start(0); } } diff --git a/engines/pink/objects/sequences/sequence_context.cpp b/engines/pink/objects/sequences/sequence_context.cpp index 1de5ac3d1d..ff7d4e8dab 100644 --- a/engines/pink/objects/sequences/sequence_context.cpp +++ b/engines/pink/objects/sequences/sequence_context.cpp @@ -47,7 +47,7 @@ SequenceContext::SequenceContext(Sequence *sequence) { sequence->setContext(this); Common::Array<SequenceItem *> &items = sequence->getItems(); - debugC(6, kPinkDebugGeneral, "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; @@ -58,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/sequencer.cpp b/engines/pink/objects/sequences/sequencer.cpp index 43f0239f03..8885fdc213 100644 --- a/engines/pink/objects/sequences/sequencer.cpp +++ b/engines/pink/objects/sequences/sequencer.cpp @@ -68,31 +68,32 @@ 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; } diff --git a/engines/pink/pink.cpp b/engines/pink/pink.cpp index 821abde6b1..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"); 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); } |