InitGlobalAnimControls();
}
-static void BlitGlobalAnimation(struct GraphicInfo *g, Bitmap *src_bitmap,
+static void BlitGlobalAnimation(struct GraphicInfo *g,
+ struct GraphicInfo *c,
+ Bitmap *src_bitmap,
int src_x, int src_y, int width, int height,
int dst_x, int dst_y, int drawing_target)
{
Bitmap *fade_bitmap =
(drawing_target == DRAW_TO_FADE_SOURCE ? gfx.fade_bitmap_source :
drawing_target == DRAW_TO_FADE_TARGET ? gfx.fade_bitmap_target : NULL);
+ int x, 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);
+ for (y = 0; y < c->stacked_yfactor; y++)
+ {
+ for (x = 0; x < c->stacked_xfactor; x++)
+ {
+ int dst_x_final = dst_x + x * (g->width + c->stacked_xoffset);
+ int dst_y_final = dst_y + y * (g->height + c->stacked_yoffset);
+
+ if (drawing_target == DRAW_TO_SCREEN)
+ blit_screen(src_bitmap, src_x, src_y, width, height,
+ dst_x_final, dst_y_final);
+ else
+ blit_bitmap(src_bitmap, fade_bitmap, src_x, src_y, width, height,
+ dst_x_final, dst_y_final);
+ }
+ }
}
static void DrawGlobalAnimationsExt(int drawing_target, int drawing_stage)
{
struct GlobalAnimPartControlInfo *part = &anim->part[part_nr];
struct GraphicInfo *g = &part->graphic_info;
+ struct GraphicInfo *c = &part->control_info;
Bitmap *src_bitmap;
int src_x, src_y;
int width = g->width;
src_x += cut_x;
src_y += cut_y;
- BlitGlobalAnimation(g, src_bitmap, src_x, src_y, width, height,
+ BlitGlobalAnimation(g, c, src_bitmap, src_x, src_y, width, height,
dst_x, dst_y, drawing_target);
}
}
{ ".active_yoffset", "0", TYPE_INTEGER },
{ ".pressed_xoffset", "0", TYPE_INTEGER },
{ ".pressed_yoffset", "0", TYPE_INTEGER },
+ { ".stacked_xfactor", "1", TYPE_INTEGER },
+ { ".stacked_yfactor", "1", TYPE_INTEGER },
+ { ".stacked_xoffset", "0", TYPE_INTEGER },
+ { ".stacked_yoffset", "0", TYPE_INTEGER },
{ NULL, NULL, 0 }
};
g->active_yoffset = parameter[GFX_ARG_ACTIVE_YOFFSET];
g->pressed_xoffset = parameter[GFX_ARG_PRESSED_XOFFSET];
g->pressed_yoffset = parameter[GFX_ARG_PRESSED_YOFFSET];
+
+ // this is only used for drawing stacked global animations
+ g->stacked_xfactor = parameter[GFX_ARG_STACKED_XFACTOR];
+ g->stacked_yfactor = parameter[GFX_ARG_STACKED_YFACTOR];
+ g->stacked_xoffset = parameter[GFX_ARG_STACKED_XOFFSET];
+ g->stacked_yoffset = parameter[GFX_ARG_STACKED_YOFFSET];
}
static void set_graphic_parameters(int graphic)