X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Ftools.c;h=9d376086cd29cc8ef196eac683f91a2aba8ffafd;hp=5051780e432522e57eb42094db5ca5b5550f4179;hb=11f481ba0c63fae52edd003696b4a3454b3c58c9;hpb=38ea4e57bc9b730abf7a15f8cc235465e6f0ad4c diff --git a/src/tools.c b/src/tools.c index 5051780e..9d376086 100644 --- a/src/tools.c +++ b/src/tools.c @@ -2057,8 +2057,15 @@ void DrawPlayer(struct PlayerInfo *player) GfxElement[jx][jy] = EL_UNDEFINED; /* make sure that pushed elements are drawn with correct frame rate */ +#if 1 + graphic = el_act_dir2img(element, ACTION_PUSHING, move_dir); + + if (player->is_pushing && player->is_moving && !IS_ANIM_MODE_CE(graphic)) + GfxFrame[jx][jy] = player->StepFrame; +#else if (player->is_pushing && player->is_moving) GfxFrame[jx][jy] = player->StepFrame; +#endif DrawLevelField(jx, jy); } @@ -2118,15 +2125,26 @@ void DrawPlayer(struct PlayerInfo *player) int px = SCREENX(jx), py = SCREENY(jy); int pxx = (TILEX - ABS(sxx)) * dx; int pyy = (TILEY - ABS(syy)) * dy; + int gfx_frame = GfxFrame[jx][jy]; int graphic; + int sync_frame; int frame; if (!IS_MOVING(jx, jy)) /* push movement already finished */ + { element = Feld[next_jx][next_jy]; + gfx_frame = GfxFrame[next_jx][next_jy]; + } graphic = el_act_dir2img(element, ACTION_PUSHING, move_dir); + +#if 1 + sync_frame = (IS_ANIM_MODE_CE(graphic) ? gfx_frame : player->StepFrame); + frame = getGraphicAnimationFrame(graphic, sync_frame); +#else frame = getGraphicAnimationFrame(graphic, player->StepFrame); +#endif /* draw background element under pushed element (like the Sokoban field) */ if (Back[next_jx][next_jy])