mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-05 09:49:14 +00:00
PINK: added basic ActionLoop implementation
This commit is contained in:
parent
f9c94a40a4
commit
65eccb7ba7
@ -38,7 +38,7 @@ public:
|
||||
virtual void update() {};
|
||||
virtual void toConsole() {};
|
||||
|
||||
virtual bool initPallete(Director *director) { return 0;}
|
||||
virtual bool initPalette(Director *director) { return 0;}
|
||||
|
||||
protected:
|
||||
Actor *_actor;
|
||||
|
@ -63,7 +63,7 @@ CelDecoder *ActionCEL::getDecoder() {
|
||||
return _decoder;
|
||||
}
|
||||
|
||||
bool ActionCEL::initPallete(Director *director) {
|
||||
bool ActionCEL::initPalette(Director *director) {
|
||||
_decoder = _actor->getPage()->loadCel(_fileName);
|
||||
_decoder->decodeNextFrame();
|
||||
_decoder->rewind();
|
||||
|
@ -41,7 +41,7 @@ public:
|
||||
uint32 getZ();
|
||||
CelDecoder *getDecoder();
|
||||
|
||||
virtual bool initPallete(Director *director);
|
||||
virtual bool initPalette(Director *director);
|
||||
|
||||
protected:
|
||||
virtual void onStart() {} ;
|
||||
|
@ -22,8 +22,9 @@
|
||||
|
||||
|
||||
#include "action_loop.h"
|
||||
#include <common/debug.h>
|
||||
#include <pink/archive.h>
|
||||
#include <pink/objects/actors/actor.h>
|
||||
#include <pink/cel_decoder.h>
|
||||
|
||||
namespace Pink {
|
||||
|
||||
@ -40,8 +41,8 @@ void ActionLoop::deserialize(Archive &archive) {
|
||||
break;
|
||||
default:
|
||||
_style = kForward;
|
||||
break;
|
||||
}
|
||||
//_style = static_cast<Style>(style);
|
||||
}
|
||||
|
||||
void ActionLoop::toConsole() {
|
||||
@ -50,4 +51,19 @@ void ActionLoop::toConsole() {
|
||||
_name.c_str(), _fileName.c_str(), _z, _startFrame, _stopFrame, _intro, _style);
|
||||
}
|
||||
|
||||
void ActionLoop::update() {
|
||||
// for now it supports only forward loop animation
|
||||
if (_style == kForward) {
|
||||
if (_decoder->endOfVideo()){
|
||||
debug("ACTION LOOP : NEXT ITERATION");
|
||||
_decoder->rewind();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ActionLoop::onStart() {
|
||||
ActionPlay::onStart();
|
||||
_actor->endAction();
|
||||
}
|
||||
|
||||
} // End of namespace Pink
|
@ -31,8 +31,10 @@ class ActionLoop : public ActionPlay {
|
||||
public:
|
||||
virtual void deserialize(Archive &archive);
|
||||
virtual void toConsole();
|
||||
|
||||
virtual void update();
|
||||
protected:
|
||||
virtual void onStart();
|
||||
|
||||
enum Style {
|
||||
kPingPong = 2,
|
||||
kRandom = 3,
|
||||
|
@ -116,7 +116,7 @@ bool Actor::isPlaying() {
|
||||
|
||||
bool Actor::initPallete(Director *director) {
|
||||
for (int i = 0; i < _actions.size(); ++i) {
|
||||
if (_actions[i]->initPallete(director))
|
||||
if (_actions[i]->initPalette(director))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user