22 #ifndef DRACI_ANIMATION_H 23 #define DRACI_ANIMATION_H 25 #include "common/array.h" 26 #include "common/list.h" 27 #include "common/rect.h" 28 #include "draci/sprite.h" 38 kWalkingMapOverlay = -2,
39 kWalkingShortestPathOverlay = -3,
40 kWalkingObliquePathOverlay = -4,
43 kInventorySprite = -7,
44 kDialogueLinesID = -8,
46 kInventoryItemsID = -13
53 enum { kIgnoreIndex = -2 };
61 typedef void (
Animation::* AnimationCallback)();
67 uint getZ()
const {
return _z; }
68 void setZ(uint z) { _z = z; }
70 void setID(
int id) { _id = id; }
71 int getID()
const {
return _id; }
73 void nextFrame(
bool force);
74 void drawFrame(
Surface *surface);
78 const Drawable *getConstCurrentFrame()
const;
81 void setCurrentFrame(uint frame);
82 uint currentFrameNum()
const {
return _currentFrame; }
83 uint getFrameCount()
const {
return _frames.size(); }
84 void makeLastFrameRelative(
int x,
int y);
87 bool isPlaying()
const {
return _playing; }
88 void setPlaying(
bool playing);
90 bool isPaused()
const {
return _paused; }
91 void setPaused(
bool paused) { _paused = paused; }
93 bool isLooping()
const {
return _looping; }
94 void setLooping(
bool looping);
96 void setIsRelative(
bool value) { _isRelative = value; }
97 bool isRelative()
const {
return _isRelative; }
98 void setRelative(
int relx,
int rely);
99 int getRelativeX()
const {
return _displacement.relX; }
100 int getRelativeY()
const {
return _displacement.relY; }
101 const Displacement &getDisplacement()
const {
return _displacement; }
105 void supportsQuickAnimation(
bool val) { _canBeQuick = val; }
107 int getIndex()
const {
return _index; }
108 void setIndex(
int index) { _index = index; }
110 void setScaleFactors(
double scaleX,
double scaleY);
111 double getScaleX()
const {
return _displacement.extraScaleX; }
112 double getScaleY()
const {
return _displacement.extraScaleY; }
114 void markDirtyRect(
Surface *surface)
const;
121 void registerCallback(AnimationCallback callback) { _callback = callback; }
125 void tellWalkingState();
132 uint nextFrameNum()
const;
148 bool _hasChangedFrame;
170 AnimationCallback _callback;
182 void insert(
Animation *anim,
bool allocateIndex);
185 void pauseAnimations();
186 void unpauseAnimations();
189 void deleteOverlays();
196 int getLastIndex()
const {
return _lastIndex; }
197 void deleteAfterIndex(
int index);
199 const Animation *getTopAnimation(
int x,
int y)
const;
202 void sortAnimations();
220 int _animationPauseCounter;
225 #endif // DRACI_ANIMATION_H
Definition: animation.h:59
Definition: animation.h:176
Definition: animation.h:30