1 // ============================================================================
2 // Rocks'n'Diamonds - McDuffin Strikes Back!
3 // ----------------------------------------------------------------------------
4 // (c) 1995-2014 by Artsoft Entertainment
7 // http://www.artsoft.org/
8 // ----------------------------------------------------------------------------
10 // ============================================================================
17 /* values for global toon animation definition */
18 #define NUM_GLOBAL_TOON_ANIMS 1
19 #define NUM_GLOBAL_TOON_PARTS MAX_NUM_TOONS
21 /* values for global animation definition (including toons) */
22 #define NUM_GLOBAL_ANIMS_AND_TOONS (NUM_GLOBAL_ANIMS + \
23 NUM_GLOBAL_TOON_ANIMS)
24 #define NUM_GLOBAL_ANIM_PARTS_AND_TOONS MAX(NUM_GLOBAL_ANIM_PARTS_ALL, \
25 NUM_GLOBAL_TOON_PARTS)
27 #define ANIM_CLASS_BIT_SUBMENU 0
28 #define ANIM_CLASS_BIT_MENU 1
29 #define ANIM_CLASS_BIT_TOONS 2
31 #define NUM_ANIM_CLASSES 3
33 #define ANIM_CLASS_NONE 0
34 #define ANIM_CLASS_SUBMENU (1 << ANIM_CLASS_BIT_SUBMENU)
35 #define ANIM_CLASS_MENU (1 << ANIM_CLASS_BIT_MENU)
36 #define ANIM_CLASS_TOONS (1 << ANIM_CLASS_BIT_TOONS)
39 struct GlobalAnimPartControlInfo
46 struct GraphicInfo graphic_info;
47 struct GraphicInfo control_info;
55 int step_xoffset, step_yoffset;
57 unsigned int initial_anim_sync_frame;
58 unsigned int step_delay, step_delay_value;
60 int init_delay_counter;
61 int anim_delay_counter;
62 int post_delay_counter;
70 struct GlobalAnimMainControlInfo
72 struct GlobalAnimPartControlInfo base;
73 struct GlobalAnimPartControlInfo part[NUM_GLOBAL_ANIM_PARTS_AND_TOONS];
78 struct GraphicInfo control_info;
86 int init_delay_counter;
91 struct GlobalAnimControlInfo
93 struct GlobalAnimMainControlInfo anim[NUM_GLOBAL_ANIMS_AND_TOONS];
99 struct GameModeAnimClass
103 } game_mode_anim_classes_list[] =
105 { GAME_MODE_LEVELS, ANIM_CLASS_TOONS | ANIM_CLASS_MENU | ANIM_CLASS_SUBMENU },
106 { GAME_MODE_LEVELNR,ANIM_CLASS_TOONS | ANIM_CLASS_MENU | ANIM_CLASS_SUBMENU },
107 { GAME_MODE_INFO, ANIM_CLASS_TOONS | ANIM_CLASS_MENU | ANIM_CLASS_SUBMENU },
108 { GAME_MODE_SETUP, ANIM_CLASS_TOONS | ANIM_CLASS_MENU | ANIM_CLASS_SUBMENU },
109 { GAME_MODE_MAIN, ANIM_CLASS_TOONS | ANIM_CLASS_MENU },
110 { GAME_MODE_SCORES, ANIM_CLASS_TOONS },
115 struct AnimClassGameMode
119 } anim_class_game_modes_list[] =
121 { ANIM_CLASS_BIT_SUBMENU, GAME_MODE_PSEUDO_SUBMENU },
122 { ANIM_CLASS_BIT_MENU, GAME_MODE_PSEUDO_MENU },
123 { ANIM_CLASS_BIT_TOONS, GAME_MODE_PSEUDO_TOONS },
128 /* forward declaration for internal use */
129 static void HandleGlobalAnim(int, int);
130 static void DoAnimationExt(void);
132 static struct GlobalAnimControlInfo global_anim_ctrl[NUM_GAME_MODES];
133 static struct ToonInfo toons[MAX_NUM_TOONS];
135 static unsigned int anim_sync_frame = 0;
136 static unsigned int anim_sync_frame_delay = 0;
137 static unsigned int anim_sync_frame_delay_value = GAME_FRAME_DELAY;
139 static int game_mode_anim_classes[NUM_GAME_MODES];
140 static int anim_class_game_modes[NUM_ANIM_CLASSES];
142 static int anim_status_last = GAME_MODE_DEFAULT;
143 static int anim_classes_last = ANIM_CLASS_NONE;
146 static int getGlobalAnimationPart(struct GlobalAnimMainControlInfo *anim)
148 struct GraphicInfo *c = &anim->control_info;
149 int last_anim_random_frame = gfx.anim_random_frame;
152 gfx.anim_random_frame = -1; // (use simple, ad-hoc random numbers)
154 part_nr = getAnimationFrame(anim->num_parts, 1,
155 c->anim_mode, c->anim_start_frame,
158 gfx.anim_random_frame = last_anim_random_frame;
163 static void PrepareBackbuffer()
165 if (game_status != GAME_MODE_PLAYING)
168 BlitScreenToBitmap(backbuffer);
171 boolean ToonNeedsRedraw()
178 int num_toons = MAX_NUM_TOONS;
181 if (global.num_toons >= 0 && global.num_toons < MAX_NUM_TOONS)
182 num_toons = global.num_toons;
184 for (i = 0; i < num_toons; i++)
186 int graphic = IMG_TOON_1 + i;
187 struct FileInfo *image = getImageListEntryFromImageID(graphic);
189 toons[i].bitmap = graphic_info[graphic].bitmap;
191 toons[i].src_x = graphic_info[graphic].src_x;
192 toons[i].src_y = graphic_info[graphic].src_y;
194 toons[i].width = graphic_info[graphic].width;
195 toons[i].height = graphic_info[graphic].height;
197 toons[i].anim_frames = graphic_info[graphic].anim_frames;
198 toons[i].anim_delay = graphic_info[graphic].anim_delay;
199 toons[i].anim_mode = graphic_info[graphic].anim_mode;
200 toons[i].anim_start_frame = graphic_info[graphic].anim_start_frame;
202 toons[i].step_offset = graphic_info[graphic].step_offset;
203 toons[i].step_delay = graphic_info[graphic].step_delay;
205 toons[i].direction = image->parameter[GFX_ARG_DIRECTION];
206 toons[i].position = image->parameter[GFX_ARG_POSITION];
209 InitToonScreen(bitmap_db_toons,
210 BackToFront, PrepareBackbuffer, ToonNeedsRedraw,
212 REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE,
216 static void InitToonControls()
218 int mode_nr_toons = GAME_MODE_PSEUDO_TOONS;
219 struct GlobalAnimControlInfo *ctrl = &global_anim_ctrl[mode_nr_toons];
220 struct GlobalAnimMainControlInfo *anim = &ctrl->anim[ctrl->num_anims];
221 int mode_nr, anim_nr, part_nr;
222 int control = IMG_INTERNAL_GLOBAL_TOON_DEFAULT;
223 int num_toons = MAX_NUM_TOONS;
226 if (global.num_toons >= 0 && global.num_toons < MAX_NUM_TOONS)
227 num_toons = global.num_toons;
229 mode_nr = mode_nr_toons;
230 anim_nr = ctrl->num_anims;
233 anim->mode_nr = mode_nr;
234 anim->control_info = graphic_info[control];
237 anim->part_counter = 0;
238 anim->active_part_nr = 0;
240 anim->has_base = FALSE;
242 anim->init_delay_counter = 0;
244 anim->state = ANIM_STATE_INACTIVE;
248 for (i = 0; i < num_toons; i++)
250 struct GlobalAnimPartControlInfo *part = &anim->part[part_nr];
251 int graphic = IMG_TOON_1 + i;
252 int control = graphic;
255 part->anim_nr = anim_nr;
256 part->mode_nr = mode_nr;
257 part->graphic = graphic;
258 part->graphic_info = graphic_info[graphic];
259 part->control_info = graphic_info[control];
261 part->graphic_info.anim_delay *= part->graphic_info.step_delay;
263 part->control_info.init_delay_fixed = 0;
264 part->control_info.init_delay_random = 150;
266 part->control_info.x = ARG_UNDEFINED_VALUE;
267 part->control_info.y = ARG_UNDEFINED_VALUE;
269 part->initial_anim_sync_frame = 0;
271 part->step_delay = 0;
272 part->step_delay_value = graphic_info[control].step_delay;
274 part->state = ANIM_STATE_INACTIVE;
275 part->last_anim_status = -1;
284 void InitGlobalAnimControls()
287 int mode_nr, anim_nr, part_nr;
288 int graphic, control;
292 ResetDelayCounter(&anim_sync_frame_delay);
294 for (m = 0; m < NUM_GAME_MODES; m++)
298 struct GlobalAnimControlInfo *ctrl = &global_anim_ctrl[mode_nr];
305 for (a = 0; a < NUM_GLOBAL_ANIMS; a++)
307 struct GlobalAnimMainControlInfo *anim = &ctrl->anim[anim_nr];
308 int ctrl_id = GLOBAL_ANIM_ID_CONTROL_FIRST + a;
310 control = global_anim_info[ctrl_id].graphic[GLOBAL_ANIM_ID_PART_BASE][m];
312 // if no base animation parameters defined, use default values
313 if (control == IMG_UNDEFINED)
314 control = IMG_INTERNAL_GLOBAL_ANIM_DEFAULT;
317 anim->mode_nr = mode_nr;
318 anim->control_info = graphic_info[control];
321 anim->part_counter = 0;
322 anim->active_part_nr = 0;
324 anim->has_base = FALSE;
326 anim->init_delay_counter = 0;
328 anim->state = ANIM_STATE_INACTIVE;
332 for (p = 0; p < NUM_GLOBAL_ANIM_PARTS_ALL; p++)
334 struct GlobalAnimPartControlInfo *part = &anim->part[part_nr];
336 graphic = global_anim_info[a].graphic[p][m];
337 control = global_anim_info[ctrl_id].graphic[p][m];
339 if (graphic == IMG_UNDEFINED || graphic_info[graphic].bitmap == NULL ||
340 control == IMG_UNDEFINED)
344 printf("::: mode == %d, anim = %d, part = %d [%d, %d, %d] [%d]\n",
345 m, a, p, mode_nr, anim_nr, part_nr, control);
349 part->anim_nr = anim_nr;
350 part->mode_nr = mode_nr;
351 part->graphic = graphic;
352 part->graphic_info = graphic_info[graphic];
353 part->control_info = graphic_info[control];
355 part->initial_anim_sync_frame = 0;
357 part->step_delay = 0;
358 part->step_delay_value = graphic_info[control].step_delay;
360 part->state = ANIM_STATE_INACTIVE;
361 part->last_anim_status = -1;
363 if (p < GLOBAL_ANIM_ID_PART_BASE)
371 anim->has_base = TRUE;
375 if (anim->num_parts > 0 || anim->has_base)
385 for (i = 0; i < NUM_GAME_MODES; i++)
386 game_mode_anim_classes[i] = ANIM_CLASS_NONE;
387 for (i = 0; game_mode_anim_classes_list[i].game_mode != -1; i++)
388 game_mode_anim_classes[game_mode_anim_classes_list[i].game_mode] =
389 game_mode_anim_classes_list[i].class;
391 for (i = 0; i < NUM_ANIM_CLASSES; i++)
392 anim_class_game_modes[i] = GAME_MODE_DEFAULT;
393 for (i = 0; anim_class_game_modes_list[i].game_mode != -1; i++)
394 anim_class_game_modes[anim_class_game_modes_list[i].class_bit] =
395 anim_class_game_modes_list[i].game_mode;
397 anim_status_last = GAME_MODE_LOADING;
398 anim_classes_last = ANIM_CLASS_NONE;
401 void InitGlobalAnimations()
403 InitGlobalAnimControls();
406 void DrawGlobalAnimExt(int drawing_stage)
410 if (global.anim_status != anim_status_last)
412 boolean before_fading = (global.anim_status == GAME_MODE_PSEUDO_FADING);
413 boolean after_fading = (anim_status_last == GAME_MODE_PSEUDO_FADING);
414 int anim_classes_next = game_mode_anim_classes[global.anim_status_next];
417 // ---------- part 1 ------------------------------------------------------
418 // start or stop global animations by change of game mode
419 // (special handling of animations for "current screen" and "all screens")
421 // stop animations for last screen
422 HandleGlobalAnim(ANIM_STOP, anim_status_last);
424 // start animations for current screen
425 HandleGlobalAnim(ANIM_START, global.anim_status);
427 // start animations for all screens after loading new artwork set
428 if (anim_status_last == GAME_MODE_LOADING)
429 HandleGlobalAnim(ANIM_START, GAME_MODE_DEFAULT);
431 // ---------- part 2 ------------------------------------------------------
432 // start or stop global animations by change of animation class
433 // (generic handling of animations for "class of screens")
435 for (i = 0; i < NUM_ANIM_CLASSES; i++)
437 int anim_class_check = (1 << i);
438 int anim_class_game_mode = anim_class_game_modes[i];
439 int anim_class_last = anim_classes_last & anim_class_check;
440 int anim_class_next = anim_classes_next & anim_class_check;
442 // stop animations for changed screen class before fading to new screen
443 if (before_fading && anim_class_last && !anim_class_next)
444 HandleGlobalAnim(ANIM_STOP, anim_class_game_mode);
446 // start animations for changed screen class after fading to new screen
447 if (after_fading && !anim_class_last && anim_class_next)
448 HandleGlobalAnim(ANIM_START, anim_class_game_mode);
452 anim_classes_last = anim_classes_next;
454 anim_status_last = global.anim_status;
457 if (!setup.toons || global.anim_status == GAME_MODE_LOADING)
460 if (drawing_stage == DRAW_GLOBAL_ANIM_STAGE_1)
463 for (mode_nr = 0; mode_nr < NUM_GAME_MODES; mode_nr++)
465 struct GlobalAnimControlInfo *ctrl = &global_anim_ctrl[mode_nr];
469 if (mode_nr != GFX_SPECIAL_ARG_DEFAULT &&
470 mode_nr != game_status)
474 for (anim_nr = 0; anim_nr < ctrl->num_anims; anim_nr++)
476 struct GlobalAnimMainControlInfo *anim = &ctrl->anim[anim_nr];
477 struct GraphicInfo *c = &anim->control_info;
478 int part_first, part_last;
481 if (!(anim->state & ANIM_STATE_RUNNING))
484 part_first = part_last = anim->active_part_nr;
486 if (c->anim_mode & ANIM_ALL || anim->num_parts == 0)
488 int num_parts = anim->num_parts + (anim->has_base ? 1 : 0);
491 part_last = num_parts - 1;
494 for (part_nr = part_first; part_nr <= part_last; part_nr++)
496 struct GlobalAnimPartControlInfo *part = &anim->part[part_nr];
497 struct GraphicInfo *g = &part->graphic_info;
500 int width = g->width;
501 int height = g->height;
509 if (!(part->state & ANIM_STATE_RUNNING))
512 if (part->drawing_stage != drawing_stage)
521 else if (part->x > part->viewport_width - g->width)
522 width -= (part->x - (part->viewport_width - g->width));
530 else if (part->y > part->viewport_height - g->height)
531 height -= (part->y - (part->viewport_height - g->height));
533 dst_x += part->viewport_x;
534 dst_y += part->viewport_y;
536 sync_frame = anim_sync_frame - part->initial_anim_sync_frame;
537 frame = getAnimationFrame(g->anim_frames, g->anim_delay,
538 g->anim_mode, g->anim_start_frame,
541 getFixedGraphicSource(part->graphic, frame, &src_bitmap,
547 BlitToScreenMasked(src_bitmap, src_x, src_y, width, height,
554 void DrawGlobalAnim(int drawing_stage)
556 DrawGlobalAnimExt(drawing_stage);
559 boolean SetGlobalAnimPart_Viewport(struct GlobalAnimPartControlInfo *part)
565 boolean changed = FALSE;
567 if (part->last_anim_status == global.anim_status)
570 part->last_anim_status = global.anim_status;
572 part->drawing_stage = DRAW_GLOBAL_ANIM_STAGE_1;
574 if (part->control_info.class == get_hash_from_key("window") ||
575 part->control_info.class == get_hash_from_key("border"))
579 viewport_width = WIN_XSIZE;
580 viewport_height = WIN_YSIZE;
582 part->drawing_stage = DRAW_GLOBAL_ANIM_STAGE_2;
584 else if (part->control_info.class == get_hash_from_key("door_1"))
588 viewport_width = DXSIZE;
589 viewport_height = DYSIZE;
591 else if (part->control_info.class == get_hash_from_key("door_2"))
595 viewport_width = VXSIZE;
596 viewport_height = VYSIZE;
598 else // default: "playfield"
600 viewport_x = REAL_SX;
601 viewport_y = REAL_SY;
602 viewport_width = FULL_SXSIZE;
603 viewport_height = FULL_SYSIZE;
606 if (viewport_x != part->viewport_x ||
607 viewport_y != part->viewport_y ||
608 viewport_width != part->viewport_width ||
609 viewport_height != part->viewport_height)
611 part->viewport_x = viewport_x;
612 part->viewport_y = viewport_y;
613 part->viewport_width = viewport_width;
614 part->viewport_height = viewport_height;
622 int HandleGlobalAnim_Part(struct GlobalAnimPartControlInfo *part, int state)
624 struct GraphicInfo *g = &part->graphic_info;
625 struct GraphicInfo *c = &part->control_info;
626 boolean viewport_changed = SetGlobalAnimPart_Viewport(part);
628 if (viewport_changed)
629 state |= ANIM_STATE_RESTART;
631 if (state & ANIM_STATE_RESTART)
633 ResetDelayCounterExt(&part->step_delay, anim_sync_frame);
635 part->init_delay_counter =
636 (c->init_delay_fixed + GetSimpleRandom(c->init_delay_random));
638 part->anim_delay_counter =
639 (c->anim_delay_fixed + GetSimpleRandom(c->anim_delay_random));
641 part->initial_anim_sync_frame =
642 (g->anim_global_sync ? 0 : anim_sync_frame + part->init_delay_counter);
644 if (c->direction & MV_HORIZONTAL)
646 int pos_bottom = part->viewport_height - g->height;
648 if (c->position == POS_TOP)
650 else if (c->position == POS_UPPER)
651 part->y = GetSimpleRandom(pos_bottom / 2);
652 else if (c->position == POS_MIDDLE)
653 part->y = pos_bottom / 2;
654 else if (c->position == POS_LOWER)
655 part->y = pos_bottom / 2 + GetSimpleRandom(pos_bottom / 2);
656 else if (c->position == POS_BOTTOM)
657 part->y = pos_bottom;
659 part->y = GetSimpleRandom(pos_bottom);
661 if (c->direction == MV_RIGHT)
663 part->step_xoffset = c->step_offset;
664 part->x = -g->width + part->step_xoffset;
668 part->step_xoffset = -c->step_offset;
669 part->x = part->viewport_width + part->step_xoffset;
672 part->step_yoffset = 0;
674 else if (c->direction & MV_VERTICAL)
676 int pos_right = part->viewport_width - g->width;
678 if (c->position == POS_LEFT)
680 else if (c->position == POS_RIGHT)
683 part->x = GetSimpleRandom(pos_right);
685 if (c->direction == MV_DOWN)
687 part->step_yoffset = c->step_offset;
688 part->y = -g->height + part->step_yoffset;
692 part->step_yoffset = -c->step_offset;
693 part->y = part->viewport_height + part->step_yoffset;
696 part->step_xoffset = 0;
703 part->step_xoffset = 0;
704 part->step_yoffset = 0;
707 if (c->x != ARG_UNDEFINED_VALUE)
709 if (c->y != ARG_UNDEFINED_VALUE)
712 if (c->step_xoffset != ARG_UNDEFINED_VALUE)
713 part->step_xoffset = c->step_xoffset;
714 if (c->step_yoffset != ARG_UNDEFINED_VALUE)
715 part->step_yoffset = c->step_yoffset;
718 if (part->init_delay_counter > 0)
720 part->init_delay_counter--;
722 return ANIM_STATE_WAITING;
725 if ((part->x <= -g->width && part->step_xoffset <= 0) ||
726 (part->x >= part->viewport_width && part->step_xoffset >= 0) ||
727 (part->y <= -g->height && part->step_yoffset <= 0) ||
728 (part->y >= part->viewport_height && part->step_yoffset >= 0))
729 return ANIM_STATE_RESTART;
731 if (part->anim_delay_counter > 0)
733 part->anim_delay_counter--;
735 if (part->anim_delay_counter == 0)
737 part->post_delay_counter =
738 (c->post_delay_fixed + GetSimpleRandom(c->post_delay_random));
740 if (part->post_delay_counter > 0)
741 return ANIM_STATE_RUNNING;
743 return ANIM_STATE_RESTART | ANIM_STATE_RUNNING;
747 if (part->post_delay_counter > 0)
749 part->post_delay_counter--;
751 if (part->post_delay_counter == 0)
752 return ANIM_STATE_RESTART;
754 return ANIM_STATE_WAITING;
757 if (!DelayReachedExt(&part->step_delay, part->step_delay_value,
759 return ANIM_STATE_RUNNING;
763 static unsigned int last_counter = -1;
764 unsigned int counter = Counter();
766 printf("::: NEXT ANIM PART [%d, %d]\n",
767 anim_sync_frame, counter - last_counter);
769 last_counter = counter;
773 part->x += part->step_xoffset;
774 part->y += part->step_yoffset;
776 return ANIM_STATE_RUNNING;
779 void HandleGlobalAnim_Main(struct GlobalAnimMainControlInfo *anim, int action)
781 struct GlobalAnimPartControlInfo *part;
782 struct GraphicInfo *c = &anim->control_info;
785 printf("::: HandleGlobalAnim_Main: %d, %d => %d\n",
786 anim->mode_nr, anim->nr, anim->num_parts);
787 printf("::: %d, %d, %d\n", global.num_toons, setup.toons, num_toons);
791 printf("::: %s(%d): %d, %d, %d [%d]\n",
792 (action == ANIM_START ? "ANIM_START" :
793 action == ANIM_CONTINUE ? "ANIM_CONTINUE" :
794 action == ANIM_STOP ? "ANIM_STOP" : "(should not happen)"),
796 anim->state & ANIM_STATE_RESTART,
797 anim->state & ANIM_STATE_WAITING,
798 anim->state & ANIM_STATE_RUNNING,
805 anim->state = ANIM_STATE_RESTART;
806 anim->part_counter = 0;
807 anim->active_part_nr = 0;
812 if (anim->state == ANIM_STATE_INACTIVE)
818 anim->state = ANIM_STATE_INACTIVE;
826 if (c->anim_mode & ANIM_ALL || anim->num_parts == 0)
828 int num_parts = anim->num_parts + (anim->has_base ? 1 : 0);
832 printf("::: HandleGlobalAnim_Main: %d, %d => %d\n",
833 anim->mode_nr, anim->nr, num_parts);
836 for (i = 0; i < num_parts; i++)
838 part = &anim->part[i];
843 anim->state = ANIM_STATE_RUNNING;
844 part->state = ANIM_STATE_RESTART;
849 if (part->state == ANIM_STATE_INACTIVE)
855 part->state = ANIM_STATE_INACTIVE;
863 part->state = HandleGlobalAnim_Part(part, part->state);
865 // when animation mode is "once", stop after animation was played once
866 if (c->anim_mode & ANIM_ONCE &&
867 part->state & ANIM_STATE_RESTART)
868 part->state = ANIM_STATE_INACTIVE;
874 if (anim->state & ANIM_STATE_RESTART) // directly after restart
875 anim->active_part_nr = getGlobalAnimationPart(anim);
877 part = &anim->part[anim->active_part_nr];
879 part->state = ANIM_STATE_RUNNING;
881 anim->state = HandleGlobalAnim_Part(part, anim->state);
883 if (anim->state & ANIM_STATE_RESTART)
884 anim->part_counter++;
886 // when animation mode is "once", stop after all animations were played once
887 if (c->anim_mode & ANIM_ONCE &&
888 anim->part_counter == anim->num_parts)
889 anim->state = ANIM_STATE_INACTIVE;
892 void HandleGlobalAnim_Mode(struct GlobalAnimControlInfo *ctrl, int action)
897 printf("::: HandleGlobalAnim_Mode: %d => %d\n",
898 ctrl->nr, ctrl->num_anims);
901 for (i = 0; i < ctrl->num_anims; i++)
902 HandleGlobalAnim_Main(&ctrl->anim[i], action);
905 static void HandleGlobalAnim(int action, int game_mode)
908 printf("::: HandleGlobalAnim [mode == %d]\n", game_status);
911 HandleGlobalAnim_Mode(&global_anim_ctrl[game_mode], action);
922 static void DoAnimationExt()
927 printf("::: DoAnimation [%d, %d]\n", anim_sync_frame, Counter());
931 WaitUntilDelayReached(&anim_sync_frame_delay, anim_sync_frame_delay_value);
934 if (DelayReached(&anim_sync_frame_delay, anim_sync_frame_delay_value))
938 for (i = 0; i < NUM_GAME_MODES; i++)
939 HandleGlobalAnim(ANIM_CONTINUE, i);
942 // force screen redraw in next frame to continue drawing global animations
943 redraw_mask = REDRAW_ALL;
949 // HandleAnimation(ANIM_CONTINUE);
952 // force screen redraw in next frame to continue drawing global animations
953 redraw_mask = REDRAW_ALL;