else if (game.use_masked_elements)
DrawLevelElement(x, y, EL_EMPTY);
- frame = getGraphicAnimationFrame(graphic, GfxFrame[x][y]);
+ frame = getGraphicAnimationFrameXY(graphic, x, y);
if (Back[x][y] || Store[x][y] || game.use_masked_elements)
DrawGraphicThruMask(sx, sy, graphic, frame);
else if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
{
int graphic = el_act2img(GfxElement[x][y], ACTION_EXPLODING);
- int frame = getGraphicAnimationFrame(graphic, GfxFrame[x][y]);
+ int frame = getGraphicAnimationFrameXY(graphic, x, y);
if (phase == delay)
TEST_DrawLevelFieldCrumbled(x, y);
dir == MV_RIGHT ? IMG_FLAMES_1_RIGHT :
dir == MV_UP ? IMG_FLAMES_1_UP :
dir == MV_DOWN ? IMG_FLAMES_1_DOWN : IMG_EMPTY);
- int frame = getGraphicAnimationFrame(graphic, GfxFrame[x][y]);
+ int frame = getGraphicAnimationFrameXY(graphic, x, y);
GfxAction[x][y] = ACTION_ATTACKING;
sync_frame);
}
+int getGraphicAnimationFrameXY(int graphic, int lx, int ly)
+{
+ return getGraphicAnimationFrame(graphic, GfxFrame[lx][ly]);
+}
+
void getGraphicSourceBitmap(int graphic, int tilesize, Bitmap **bitmap)
{
struct GraphicInfo *g = &graphic_info[graphic];
SetRandomAnimationValue(lx, ly);
graphic = el_act_dir2img(element, GfxAction[lx][ly], GfxDir[lx][ly]);
- frame = getGraphicAnimationFrame(graphic, GfxFrame[lx][ly]);
+ frame = getGraphicAnimationFrameXY(graphic, lx, ly);
// do not use double (EM style) movement graphic when not moving
if (graphic_info[graphic].double_movement && !dx && !dy)
{
graphic = el_act_dir2img(element, ACTION_DEFAULT, GfxDir[lx][ly]);
- frame = getGraphicAnimationFrame(graphic, GfxFrame[lx][ly]);
+ frame = getGraphicAnimationFrameXY(graphic, lx, ly);
}
if (game.use_masked_elements && (dx || dy))
if (game.use_masked_elements)
{
int graphic0 = el2img(EL_EMPTY);
- int frame0 = getGraphicAnimationFrame(graphic0, GfxFrame[x][y]);
+ int frame0 = getGraphicAnimationFrameXY(graphic0, x, y);
Bitmap *src_bitmap0;
int src_x0, src_y0;
// only needed when using masked elements
int graphic0 = el2img(EL_EMPTY);
- int frame0 = getGraphicAnimationFrame(graphic0, GfxFrame[x][y]);
+ int frame0 = getGraphicAnimationFrameXY(graphic0, x, y);
Bitmap *src_bitmap0;
int src_x0, src_y0;
}
static void DrawGraphicAnimationExt(DrawBuffer *dst_bitmap, int x, int y,
- int graphic, int sync_frame,
+ int graphic, int lx, int ly,
int mask_mode)
{
- int frame = getGraphicAnimationFrame(graphic, sync_frame);
+ int frame = getGraphicAnimationFrameXY(graphic, lx, ly);
if (mask_mode == USE_MASKING)
DrawGraphicThruMaskExt(dst_bitmap, x, y, graphic, frame);
}
DrawGraphicAnimationExt(drawto_field, FX + x * TILEX_VAR, FY + y * TILEY_VAR,
- graphic, GfxFrame[lx][ly], mask_mode);
+ graphic, lx, ly, mask_mode);
MarkTileDirty(x, y);
}
}
DrawGraphicAnimationExt(drawto_field, FX + x * TILEX, FY + y * TILEY,
- graphic, GfxFrame[lx][ly], mask_mode);
+ graphic, lx, ly, mask_mode);
MarkTileDirty(x, y);
}
if (IS_ACTIVE_BOMB(element))
{
int graphic = el2img(element);
- int frame = getGraphicAnimationFrame(graphic, GfxFrame[jx][jy]);
+ int frame = getGraphicAnimationFrameXY(graphic, jx, jy);
if (game.emulation == EMU_SUPAPLEX)
DrawGraphic(sx, sy, IMG_SP_DISK_RED, frame);