24 #ifndef SAGA_ANIMATION_H 25 #define SAGA_ANIMATION_H 29 #define MAX_ANIMATIONS 10 30 #define DEFAULT_FRAME_TIME 140 32 #define SAGA_FRAME_START 0xF 33 #define SAGA_FRAME_END 0x3F 34 #define SAGA_FRAME_NOOP 0x1F 35 #define SAGA_FRAME_REPOSITION 0x30 36 #define SAGA_FRAME_ROW_END 0x2F 37 #define SAGA_FRAME_LONG_COMPRESSED_RUN 0x20 38 #define SAGA_FRAME_LONG_UNCOMPRESSED_RUN 0x10 39 #define SAGA_FRAME_COMPRESSED_RUN 0x80 40 #define SAGA_FRAME_UNCOMPRESSED_RUN 0x40 41 #define SAGA_FRAME_EMPTY_RUN 0xC0 43 #define SAGA_FRAME_AMIGA_OPCODE_REPOSITION 0x00 44 #define SAGA_FRAME_AMIGA_OPCODE_LITERAL 0x40 45 #define SAGA_FRAME_AMIGA_OPCODE_TRANSPARENT 0xC0 46 #define SAGA_FRAME_AMIGA_OPCODE_NEWLINE 0x80 47 #define SAGA_FRAME_AMIGA_OPCODE_MASK 0xC0 48 #define SAGA_FRAME_AMIGA_PARAM_MASK 0x3F 49 #define SAGA_FRAME_AMIGA_END 0x3F 50 #define SAGA_FRAME_AMIGA_START 0x3E 59 ANIM_FLAG_NONE = 0x00,
60 ANIM_FLAG_ENDSCENE = 0x01
66 uint16 backgroundResourceId;
67 uint16 animResourceId;
105 void loadCutawayList(
const ByteArray &resourceData);
106 void clearCutawayList();
107 int playCutaway(
int cut,
bool fade);
109 void returnFromCutaway();
111 void showCutawayBg(
int bg);
113 void startVideo(
int vid,
bool fade);
115 void returnFromVideo();
117 void load(uint16 animId,
const ByteArray &resourceData);
118 void freeId(uint16 animId);
119 void play(uint16 animId,
int vectorTime,
bool playing =
true);
120 void link(int16 animId1, int16 animId2);
121 void setFlag(uint16 animId, uint16 flag);
122 void clearFlag(uint16 animId, uint16 flag);
123 void setFrameTime(uint16 animId,
int time);
127 void setCycles(uint16 animId,
int cycles);
128 void stop(uint16 animId);
129 void finish(uint16 animId);
130 void resume(uint16 animId,
int cycles);
132 int16 getCurrentFrame(uint16 animId);
133 int getFrameTime(uint16 animId);
134 int getCycles(uint16 animId);
135 bool isPlaying(uint16 animId);
137 bool hasAnimation(uint16 animId) {
138 if (animId >= MAX_ANIMATIONS) {
139 if (animId < MAX_ANIMATIONS +
ARRAYSIZE(_cutawayAnimations))
140 return (_cutawayAnimations[animId - MAX_ANIMATIONS] != NULL);
143 return (_animations[animId] != NULL);
146 bool hasCutaway() {
return _cutawayActive; }
147 void setCutAwayMode(
int mode) { _cutAwayMode = mode; }
153 void decodeFrame(
AnimationData *anim,
size_t frameOffset, byte *buf,
size_t bufLength);
154 int fillFrameOffsets(
AnimationData *anim,
bool reallyFill =
true);
156 void validateAnimationId(uint16 animId) {
157 if (animId >= MAX_ANIMATIONS) {
159 if (animId >= MAX_ANIMATIONS +
ARRAYSIZE(_cutawayAnimations))
160 error(
"validateAnimationId: animId out of range");
161 if (_cutawayAnimations[animId - MAX_ANIMATIONS] == NULL) {
162 error(
"validateAnimationId: animId=%i unassigned", animId);
166 if (_animations[animId] == NULL) {
167 error(
"validateAnimationId: animId=%i unassigned.", animId);
172 bool isLongData()
const {
173 if ((_vm->getGameId() == GID_ITE) && (_vm->getPlatform() != Common::kPlatformMacintosh)) {
180 validateAnimationId(animId);
181 if (animId >= MAX_ANIMATIONS)
182 return _cutawayAnimations[animId - MAX_ANIMATIONS];
183 return _animations[animId];
186 uint16 getAnimationCount()
const {
188 for (; i < MAX_ANIMATIONS; i++) {
189 if (_animations[i] == NULL) {
208 #endif // ANIMATION_H_ #define ARRAYSIZE(x)
Definition: util.h:91
Definition: animation.h:73
void NORETURN_PRE error(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
Definition: animation.h:100
Definition: animation.h:65