[Scummvm-git-logs] scummvm master -> cd87d769327dfb760460be471d7ffda63e339685

whiterandrek whiterandrek at gmail.com
Sat Jul 21 20:13:07 CEST 2018


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
cd87d76932 PINK: added more debug output, removed unneeded


Commit: cd87d769327dfb760460be471d7ffda63e339685
    https://github.com/scummvm/scummvm/commit/cd87d769327dfb760460be471d7ffda63e339685
Author: Andrei Prykhodko (whiterandrek at gmail.com)
Date: 2018-07-21T19:40:12+03:00

Commit Message:
PINK: added more debug output, removed unneeded

Changed paths:
    engines/pink/objects/actions/action_hide.cpp
    engines/pink/objects/actions/action_loop.cpp
    engines/pink/objects/actions/action_loop.h
    engines/pink/objects/actions/action_play.cpp
    engines/pink/objects/actions/action_play_with_sfx.cpp
    engines/pink/objects/actions/action_play_with_sfx.h
    engines/pink/objects/actions/action_sound.cpp
    engines/pink/objects/actions/action_still.cpp
    engines/pink/objects/sequences/sequence.cpp
    engines/pink/objects/sequences/sequence_context.cpp
    engines/pink/objects/sequences/sequencer.cpp
    engines/pink/pink.cpp
    engines/pink/pink.h
    engines/pink/resource_mgr.cpp


diff --git a/engines/pink/objects/actions/action_hide.cpp b/engines/pink/objects/actions/action_hide.cpp
index 6eeba8a..10c41c2 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 42caef3..c8ef5da 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 263d5a6..15e9784 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 dccfade..fb4f05f 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 328bca0..0c8aa94 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 64a19d4..2797604 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 6491c09..4d4918f 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 33bb324..7150515 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 9afeb8b..44bfbf9 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 1de5ac3..ff7d4e8 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 43f0239..8885fdc 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 821abde..18e1dcb 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 ac70e1b..da7ac49 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 f9a2481..52f9283 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);
 }





More information about the Scummvm-git-logs mailing list