aboutsummaryrefslogtreecommitdiff
path: root/engines/access/animation.h
diff options
context:
space:
mode:
authorPaul Gilbert2014-08-10 22:25:30 -0400
committerPaul Gilbert2014-08-10 22:25:30 -0400
commit69ecc15c028208f6b0f28d6df4d86d1a8ba7e26a (patch)
tree44bd3a2a8f88bda3e3def5cbcc674a722f19fbbf /engines/access/animation.h
parentb6c946003198d84112e87cc2974eac6e9dc7c4f4 (diff)
downloadscummvm-rg350-69ecc15c028208f6b0f28d6df4d86d1a8ba7e26a.tar.gz
scummvm-rg350-69ecc15c028208f6b0f28d6df4d86d1a8ba7e26a.tar.bz2
scummvm-rg350-69ecc15c028208f6b0f28d6df4d86d1a8ba7e26a.zip
ACCESS: Add decoding of animation resources
Diffstat (limited to 'engines/access/animation.h')
-rw-r--r--engines/access/animation.h53
1 files changed, 49 insertions, 4 deletions
diff --git a/engines/access/animation.h b/engines/access/animation.h
index 879d1e9318..45a59efb68 100644
--- a/engines/access/animation.h
+++ b/engines/access/animation.h
@@ -25,41 +25,86 @@
#include "common/scummsys.h"
#include "common/array.h"
+#include "common/memstream.h"
#include "access/data.h"
namespace Access {
+class AnimationResource;
class Animation;
+class AnimationFrame;
+class AnimationFramePart;
class AnimationManager : public Manager {
public:
- const byte *_anim;
- Animation *_animation;
Common::Array<Animation *> _animationTimers;
+ AnimationResource *_animation;
+ Animation *_animStart;
public:
AnimationManager(AccessEngine *vm);
~AnimationManager();
void freeAnimationData();
+ void loadAnimations(const byte *data, int size);
+
void clearTimers();
Animation *findAnimation(int animId);
Animation *setAnimation(int animId);
void setAnimTimer(Animation *anim);
+
+ void animate(int animId);
+};
+
+class AnimationResource {
+private:
+ Common::Array<Animation *> _animations;
+public:
+ AnimationResource(const byte *data, int size);
+ ~AnimationResource();
+
+ int getCount() { return _animations.size(); }
+ Animation *getAnimation(int idx) { return _animations[idx]; }
};
class Animation {
+private:
+ Common::Array<AnimationFrame *> _frames;
public:
int _type;
int _scaling;
int _frameNumber;
- int _ticks;
+ int _initialTicks;
int _loopCount;
int _countdownTicks;
int _currentLoopCount;
int _field10;
public:
- Animation(const byte *data);
+ Animation(Common::MemoryReadStream &stream);
+ ~Animation();
+
+ void animate();
+};
+
+class AnimationFrame {
+public:
+ int _baseX, _baseY;
+ int _frameDelay;
+ Common::Array<AnimationFramePart *> _parts;
+public:
+ AnimationFrame(Common::MemoryReadStream &stream, int startOffset);
+ ~AnimationFrame();
+};
+
+class AnimationFramePart {
+public:
+ byte _flags;
+ int _slotIndex;
+ int _spriteIndex;
+ Common::Point _position;
+ int _priority;
+public:
+ AnimationFramePart(Common::MemoryReadStream &stream);
};
} // End of namespace Access