MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / Animation_Tick

Function Animation_Tick

src/animation.c:272–309  ·  view source on GitHub ↗

* Check all Animations if they need changing. */

Source from the content-addressed store, hash-verified

270 * Check all Animations if they need changing.
271 */
272void Animation_Tick(void)
273{
274 Animation *animation = g_animations;
275 int i;
276
277 if (s_animationTimer > g_timerGUI) return;
278 s_animationTimer += 10000;
279
280 for (i = 0; i < ANIMATION_MAX; i++, animation++) {
281 if (animation->commands == NULL) continue;
282
283 if (animation->tickNext <= g_timerGUI) {
284 const AnimationCommandStruct *commands = animation->commands + animation->current;
285 int16 parameter = commands->parameter;
286 assert((parameter & 0x0800) == 0 || (parameter & 0xF000) != 0); /* Validate if the compiler sign-extends correctly */
287
288 animation->current++;
289
290 switch (commands->command) {
291 case ANIMATION_STOP:
292 default: Animation_Func_Stop(animation, parameter); break;
293
294 case ANIMATION_ABORT: Animation_Func_Abort(animation, parameter); break;
295 case ANIMATION_SET_OVERLAY_TILE: Animation_Func_SetOverlayTile(animation, parameter); break;
296 case ANIMATION_PAUSE: Animation_Func_Pause(animation, parameter); break;
297 case ANIMATION_REWIND: Animation_Func_Rewind(animation, parameter); break;
298 case ANIMATION_PLAY_VOICE: Animation_Func_PlayVoice(animation, parameter); break;
299 case ANIMATION_SET_GROUND_TILE: Animation_Func_SetGroundTile(animation, parameter); break;
300 case ANIMATION_FORWARD: Animation_Func_Forward(animation, parameter); break;
301 case ANIMATION_SET_ICONGROUP: Animation_Func_SetIconGroup(animation, parameter); break;
302 }
303
304 if (animation->commands == NULL) continue;
305 }
306
307 if (animation->tickNext < s_animationTimer) s_animationTimer = animation->tickNext;
308 }
309}

Callers 1

GUI_DrawScreenFunction · 0.85

Calls 9

Animation_Func_StopFunction · 0.85
Animation_Func_AbortFunction · 0.85
Animation_Func_PauseFunction · 0.85
Animation_Func_RewindFunction · 0.85
Animation_Func_PlayVoiceFunction · 0.85
Animation_Func_ForwardFunction · 0.85

Tested by

no test coverage detected