From: Holger Schemel Date: Fri, 19 Nov 2021 08:55:52 +0000 (+0100) Subject: added support for tiled level border graphics X-Git-Tag: 4.3.1.0~26 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=bdab944cbf455752171f10c2451e5ce45de693b8;p=rocksndiamonds.git added support for tiled level border graphics --- diff --git a/src/tools.c b/src/tools.c index e16a35ff..08f2cc1e 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1490,8 +1490,8 @@ int getGraphicAnimationFrameXY(int graphic, int lx, int ly) 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 x = (lx + xoffset + xsize) % xsize; + int y = (ly + yoffset + ysize) % ysize; int sync_frame = y * xsize + x; return sync_frame % g->anim_frames; @@ -2007,7 +2007,7 @@ void DrawScreenElementExt(int x, int y, int dx, int dy, int element, else // border element { graphic = el2img(element); - frame = getGraphicAnimationFrame(graphic, -1); + frame = getGraphicAnimationFrameXY(graphic, lx, ly); } if (element == EL_EXPANDABLE_WALL)