rnd-20060815-1-src
authorHolger Schemel <info@artsoft.org>
Mon, 14 Aug 2006 23:23:26 +0000 (01:23 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:52:47 +0000 (10:52 +0200)
* fixed bug with displaying pushed CE with value/score/delay anim_mode

ChangeLog
src/conftime.h
src/main.h
src/tools.c

index c3bf824dfb56f273e25f1561e750442cd0cb7c15..8a1c2b9bc7f7243a46f6d9ba1d57dfbc3f8ef72a 100644 (file)
--- 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.)
index acdf414a7e8bd7874ef8b61cd61395c1035ba9f4..de4cb82e4a56d1fa0449d1ed18af4900ad9d9121 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2006-08-12 22:11]"
+#define COMPILE_DATE_STRING "[2006-08-15 01:20]"
index 8d79c60cb208a8b446c6df10006ff70f25500052..99cdc705096c395141ad2e5755a2bc5e18eff8d3 100644 (file)
 #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))
index 5051780e432522e57eb42094db5ca5b5550f4179..9d376086cd29cc8ef196eac683f91a2aba8ffafd 100644 (file)
@@ -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])