string_has_parameter(value, "vertical") ? ANIM_VERTICAL :
string_has_parameter(value, "centered") ? ANIM_CENTERED :
string_has_parameter(value, "all") ? ANIM_ALL :
+ string_has_parameter(value, "tiled") ? ANIM_TILED :
ANIM_DEFAULT);
if (string_has_parameter(value, "once"))
#define ANIM_STATIC_PANEL (1 << 13)
#define ANIM_ALL (1 << 14)
#define ANIM_ONCE (1 << 15)
+#define ANIM_TILED (1 << 16)
#define ANIM_DEFAULT ANIM_LOOP
int getGraphicAnimationFrameXY(int graphic, int lx, int ly)
{
+ if (graphic_info[graphic].anim_mode & ANIM_TILED)
+ {
+ struct GraphicInfo *g = &graphic_info[graphic];
+ int xsize = MAX(1, g->anim_frames_per_line);
+ int ysize = MAX(1, g->anim_frames / xsize);
+ int xoffset = g->anim_start_frame % xsize;
+ int yoffset = g->anim_start_frame % ysize;
+ int x = (lx + xoffset) % xsize;
+ int y = (ly + yoffset) % ysize;
+ int sync_frame = y * xsize + x;
+
+ return sync_frame % g->anim_frames;
+ }
+
return getGraphicAnimationFrame(graphic, GfxFrame[lx][ly]);
}