X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=a3e5306835f7082e83a21f22c3dc053f13f5257d;hb=1e23125074b86c5eb1254037a81a3e9062152b7f;hp=08f2cc1e56d4ceb22df90824ce61fcd9433b2423;hpb=bdab944cbf455752171f10c2451e5ce45de693b8;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index 08f2cc1e..a3e53068 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1496,6 +1496,15 @@ int getGraphicAnimationFrameXY(int graphic, int lx, int ly) return sync_frame % g->anim_frames; } + else if (graphic_info[graphic].anim_mode & ANIM_RANDOM_STATIC) + { + struct GraphicInfo *g = &graphic_info[graphic]; + int x = (lx + lev_fieldx) % lev_fieldx; + int y = (ly + lev_fieldy) % lev_fieldy; + int sync_frame = GfxRandomStatic[x][y]; + + return sync_frame % g->anim_frames; + } return getGraphicAnimationFrame(graphic, GfxFrame[lx][ly]); } @@ -1987,6 +1996,9 @@ void DrawScreenElementExt(int x, int y, int dx, int dy, int element, int graphic; int frame; + if (element == EL_EMPTY) + element = GfxElementEmpty[lx][ly]; + if (IN_LEV_FIELD(lx, ly)) { SetRandomAnimationValue(lx, ly); @@ -3951,6 +3963,9 @@ void DrawLevelGraphicAnimationIfNeeded(int x, int y, int graphic) if (!IS_NEW_FRAME(GfxFrame[x][y], graphic)) return; + if (ANIM_MODE(graphic) & (ANIM_TILED | ANIM_RANDOM_STATIC)) + return; + DrawGraphicAnimation(sx, sy, graphic); #if 1