X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=2474eb908345df14e5bad4eb6b8a5df47adc05cb;hb=18c6de22b68eae843865c82b2def4f2a25cf738f;hp=354f196c48797f47612d8157fa2650029fa848c5;hpb=4be46f1030df4cb7db0ce7c46d2518334861731a;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index 354f196c..2474eb90 100644 --- a/src/tools.c +++ b/src/tools.c @@ -479,12 +479,25 @@ inline void DrawGraphicAnimationExt(DrawBuffer *dst_bitmap, int x, int y, DrawGraphicExt(dst_bitmap, x, y, graphic, frame); } +inline boolean checkDrawGraphicAnimation(int x, int y, int graphic) +{ + int lx = LEVELX(x), ly = LEVELY(y); + + return (IN_SCR_FIELD(x, y) && + GfxFrame[lx][ly] % new_graphic_info[graphic].anim_delay == 0); +} + +inline boolean checkDrawLevelGraphicAnimation(int x, int y, int graphic) +{ + return (IN_SCR_FIELD(SCREENX(x), SCREENY(y)) && + GfxFrame[x][y] % new_graphic_info[graphic].anim_delay == 0); +} + inline boolean DrawGraphicAnimation(int x, int y, int graphic) { int lx = LEVELX(x), ly = LEVELY(y); - if (!IN_SCR_FIELD(x, y) || - (GfxFrame[lx][ly] % new_graphic_info[graphic].anim_delay) != 0) + if (!checkDrawGraphicAnimation(x, y, graphic)) return FALSE; DrawGraphicAnimationExt(drawto_field, FX + x * TILEX, FY + y * TILEY, @@ -777,11 +790,17 @@ void DrawPlayer(struct PlayerInfo *player) frame = 7 - frame; } #else + +#if 0 frame = getGraphicAnimationFrame(graphic, 96 - MovDelay[jx][jy]); +#else + frame = getGraphicAnimationFrame(graphic, GfxFrame[jx][jy]); +#endif + #endif if (game.emulation == EMU_SUPAPLEX) - DrawGraphic(sx, sy, IMG_SP_DISK_RED, 0); + DrawGraphic(sx, sy, IMG_SP_DISK_RED, frame); else DrawGraphicThruMask(sx, sy, graphic, frame); }