From: Holger Schemel Date: Mon, 14 Aug 2006 23:23:26 +0000 (+0200) Subject: rnd-20060815-1-src X-Git-Tag: 3.2.1^2~14 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=11f481ba0c63fae52edd003696b4a3454b3c58c9 rnd-20060815-1-src * fixed bug with displaying pushed CE with value/score/delay anim_mode --- diff --git a/ChangeLog b/ChangeLog index c3bf824d..8a1c2b9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2006-08-14 + * fixed bug with displaying pushed CE with value/score/delay anim_mode + 2006-08-12 * added configurable level preview position, tile size and dimensions * added configurable game panel value positions (gems, time, score etc.) diff --git a/src/conftime.h b/src/conftime.h index acdf414a..de4cb82e 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2006-08-12 22:11]" +#define COMPILE_DATE_STRING "[2006-08-15 01:20]" diff --git a/src/main.h b/src/main.h index 8d79c60c..99cdc705 100644 --- a/src/main.h +++ b/src/main.h @@ -780,6 +780,9 @@ #define ANIM_DELAY(g) (graphic_info[g].anim_delay) #define ANIM_MODE(g) (graphic_info[g].anim_mode) +#define IS_ANIM_MODE_CE(g) (graphic_info[g].anim_mode & (ANIM_CE_VALUE | \ + ANIM_CE_SCORE | \ + ANIM_CE_DELAY)) #define IS_ANIMATED(g) (ANIM_FRAMES(g) > 1) #define IS_NEW_DELAY(f, g) ((f) % ANIM_DELAY(g) == 0) #define IS_NEW_FRAME(f, g) (IS_ANIMATED(g) && IS_NEW_DELAY(f, g)) 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])