X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=773a59db1efd0efbe2a2ab69b5d6cf566ff7c37a;hb=e85f102990a880fc2ec51e64a1f1ced4ad9e19df;hp=aacba67058f44f8bebadf1863a52c87cb4bd551e;hpb=2d769736ea3634a55a88c1d792ffdbefb190d1f3;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index aacba670..773a59db 100644 --- a/src/tools.c +++ b/src/tools.c @@ -2720,9 +2720,10 @@ void DrawPlayer(struct PlayerInfo *player) /* draw background element under pushed element (like the Sokoban field) */ #if 1 - /* this allows transparent pushing animation over non-black background */ - if (IS_MOVING(jx, jy)) + if (game.use_masked_pushing && IS_MOVING(jx, jy)) { + /* this allows transparent pushing animation over non-black background */ + if (Back[jx][jy]) DrawLevelElement(jx, jy, Back[jx][jy]); else @@ -2733,6 +2734,8 @@ void DrawPlayer(struct PlayerInfo *player) else DrawLevelElement(next_jx, next_jy, EL_EMPTY); } + else if (Back[next_jx][next_jy]) + DrawLevelElement(next_jx, next_jy, Back[next_jx][next_jy]); #else if (Back[next_jx][next_jy]) DrawLevelElement(next_jx, next_jy, Back[next_jx][next_jy]); @@ -7732,6 +7735,29 @@ void InitGraphicInfo_EM(void) #endif } +void getGraphicSource_SP(struct GraphicInfo_SP *g_sp, + int graphic, int sync_frame, int x, int y) +{ + int frame = getGraphicAnimationFrame(graphic, sync_frame); + + getGraphicSource(graphic, frame, &g_sp->bitmap, &g_sp->src_x, &g_sp->src_y); +} + +boolean isRandomAnimation_SP(int graphic) +{ + return (ANIM_MODE(graphic) == ANIM_RANDOM); +} + +boolean isNextAnimationFrame_SP(int graphic, int sync_frame) +{ + return (IS_NEXT_FRAME(sync_frame, graphic)); +} + +int getGraphicInfo_Delay(int graphic) +{ + return graphic_info[graphic].anim_delay; +} + void PlayMenuSoundExt(int sound) { if (sound == SND_UNDEFINED)