aboutsummaryrefslogtreecommitdiff
path: root/engines/pink/objects/actions/action_cel.cpp
diff options
context:
space:
mode:
authorwhitertandrek2018-03-23 21:51:13 +0200
committerEugene Sandulenko2018-06-28 23:51:32 +0200
commitbba35c5f2c71aa8c83c7ba9180f08ce7f609c911 (patch)
tree0d5facef654579f8d7c22ac428fc1d5208daef7f /engines/pink/objects/actions/action_cel.cpp
parent26f2ff66402d6469b34b627278bcd2678a7f9119 (diff)
downloadscummvm-rg350-bba35c5f2c71aa8c83c7ba9180f08ce7f609c911.tar.gz
scummvm-rg350-bba35c5f2c71aa8c83c7ba9180f08ce7f609c911.tar.bz2
scummvm-rg350-bba35c5f2c71aa8c83c7ba9180f08ce7f609c911.zip
PINK: Started implementation of Director class . For now engine can play logo scene, but sprites are at wrong positions because decoder doesn't support getting coordinates from CEL
Diffstat (limited to 'engines/pink/objects/actions/action_cel.cpp')
-rw-r--r--engines/pink/objects/actions/action_cel.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/engines/pink/objects/actions/action_cel.cpp b/engines/pink/objects/actions/action_cel.cpp
index f1c350473f..5385386b39 100644
--- a/engines/pink/objects/actions/action_cel.cpp
+++ b/engines/pink/objects/actions/action_cel.cpp
@@ -22,13 +22,49 @@
#include <common/debug.h>
#include "action_cel.h"
+#include <pink/objects/actors/actor.h>
#include "engines/pink/archive.h"
+#include "engines/pink/objects/pages/game_page.h"
+#include "pink/pink.h"
namespace Pink {
+ActionCEL::ActionCEL()
+ : _flicDecoder(nullptr) {
+
+}
+
void ActionCEL::deserialize(Archive &archive) {
Action::deserialize(archive);
archive >> _fileName >> _z;
}
+void ActionCEL::start(bool unk) {
+ if (!_flicDecoder)
+ _flicDecoder = _actor->getPage()->loadCel(_fileName);
+ _actor->getPage()->getGame()->getDirector()->addSprite(this);
+ this->onStart();
+}
+
+void ActionCEL::end() {
+ _actor->getPage()->getGame()->getDirector()->removeSprite(this);
+ delete _flicDecoder;
+ _flicDecoder = nullptr;
+}
+
+uint32 ActionCEL::getZ() {
+ return _z;
+}
+
+Video::FlicDecoder *ActionCEL::getDecoder() {
+ return _flicDecoder;
+}
+
+bool ActionCEL::initPallete(Director *director) {
+ _flicDecoder = _actor->getPage()->loadCel(_fileName);
+ _flicDecoder->decodeNextFrame();
+ director->setPallette(_flicDecoder->getPalette());
+ return 1;
+}
+
} // End of namespace Pink \ No newline at end of file