projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
71cea4c
)
moved code to separate function
author
Holger Schemel
<info@artsoft.org>
Wed, 8 Feb 2023 19:53:07 +0000
(20:53 +0100)
committer
Holger Schemel
<info@artsoft.org>
Wed, 8 Feb 2023 19:53:07 +0000
(20:53 +0100)
src/anim.c
patch
|
blob
|
history
diff --git
a/src/anim.c
b/src/anim.c
index 50075c832ab8b42b4993c7c8fa7f7871aeac831c..1fb0672e2e50138d0b46674b6999e25cb43d7196 100644
(file)
--- a/
src/anim.c
+++ b/
src/anim.c
@@
-636,11
+636,28
@@
void InitGlobalAnimations(void)
InitGlobalAnimControls();
}
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);
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 game_mode_anim_action[NUM_GAME_MODES];
int mode_nr;
@@
-793,10
+810,6
@@
static void DrawGlobalAnimationsExt(int drawing_target, int drawing_stage)
int cut_y = 0;
int sync_frame;
int frame;
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))
int last_anim_random_frame = gfx.anim_random_frame;
if (!(part->state & ANIM_STATE_RUNNING))
@@
-851,12
+864,8
@@
static void DrawGlobalAnimationsExt(int drawing_target, int drawing_stage)
src_x += cut_x;
src_y += cut_y;
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);
}
}
}
}
}
}