InitGlobalAnimControls();
}
-static void DrawGlobalAnimationsExt(int drawing_target, int drawing_stage)
+static void BlitGlobalAnimation(struct GraphicInfo *g, Bitmap *src_bitmap,
+ int src_x, int src_y, int width, int height,
+ int dst_x, int dst_y, int drawing_target)
{
+ void (*blit_bitmap)(Bitmap *, Bitmap *, int, int, int, int, int, int) =
+ (g->draw_masked ? BlitBitmapMasked : BlitBitmap);
+ void (*blit_screen)(Bitmap *, int, int, int, int, int, int) =
+ (g->draw_masked ? BlitToScreenMasked : BlitToScreen);
Bitmap *fade_bitmap =
(drawing_target == DRAW_TO_FADE_SOURCE ? gfx.fade_bitmap_source :
drawing_target == DRAW_TO_FADE_TARGET ? gfx.fade_bitmap_target : NULL);
+
+ if (drawing_target == DRAW_TO_SCREEN)
+ blit_screen(src_bitmap, src_x, src_y, width, height,
+ dst_x, dst_y);
+ else
+ blit_bitmap(src_bitmap, fade_bitmap, src_x, src_y, width, height,
+ dst_x, dst_y);
+}
+
+static void DrawGlobalAnimationsExt(int drawing_target, int drawing_stage)
+{
int game_mode_anim_action[NUM_GAME_MODES];
int mode_nr;
int cut_y = 0;
int sync_frame;
int frame;
- void (*blit_bitmap)(Bitmap *, Bitmap *, int, int, int, int, int, int) =
- (g->draw_masked ? BlitBitmapMasked : BlitBitmap);
- void (*blit_screen)(Bitmap *, int, int, int, int, int, int) =
- (g->draw_masked ? BlitToScreenMasked : BlitToScreen);
int last_anim_random_frame = gfx.anim_random_frame;
if (!(part->state & ANIM_STATE_RUNNING))
src_x += cut_x;
src_y += cut_y;
- if (drawing_target == DRAW_TO_SCREEN)
- blit_screen(src_bitmap, src_x, src_y, width, height,
- dst_x, dst_y);
- else
- blit_bitmap(src_bitmap, fade_bitmap, src_x, src_y, width, height,
- dst_x, dst_y);
+ BlitGlobalAnimation(g, src_bitmap, src_x, src_y, width, height,
+ dst_x, dst_y, drawing_target);
}
}
}