rnd-20051201-1-src
authorHolger Schemel <info@artsoft.org>
Thu, 1 Dec 2005 01:18:40 +0000 (02:18 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:49:32 +0000 (10:49 +0200)
ChangeLog
src/conftime.h
src/game.c
src/tools.c

index 950fe3174103317b10ebe2e27cc98ba2dbb4d790..f8eec8df88b89906ec8b546dac87901c1590f718 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,7 +17,7 @@
          (should be '#include <SDL.h>' instead)
 
 2005-08-20
-       * fixed bug preventing "walkable from no direction" from being ignored
+       * fixed bug which prevented "walkable from no direction" from working
          (due to compatibility code overwriting this setting after loading)
 
 2005-08-15
index 8ef82a43b6a151a795c2b15be066ce968fc136e7..49683cd474e1a367700158322ae9d7a626575404 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2005-11-29 00:04]"
+#define COMPILE_DATE_STRING "[2005-12-01 02:15]"
index 239a6a7008911d93ad1e48920c546da37a8fd315..9bea6aae0330e532290662908f43b0378f578e48 100644 (file)
@@ -29,6 +29,7 @@
 
 #define USE_NEW_SP_SLIPPERY            (TRUE   * USE_NEW_STUFF         * 1)
 #define USE_NEW_COLLECT_COUNT          (TRUE   * USE_NEW_STUFF         * 1)
+#define USE_NEW_PLAYER_ANIM            (TRUE   * USE_NEW_STUFF         * 1)
 
 
 /* for DigField() */
 #define INITIAL_MOVE_DELAY_ON  0
 
 /* values for player movement speed (which is in fact a delay value) */
+#define MOVE_DELAY_MIN_SPEED   32
 #define MOVE_DELAY_NORMAL_SPEED        8
 #define MOVE_DELAY_HIGH_SPEED  4
+#define MOVE_DELAY_MAX_SPEED   1
 
+#if 0
 #define DOUBLE_MOVE_DELAY(x)   (x = (x <= MOVE_DELAY_HIGH_SPEED ? x * 2 : x))
 #define HALVE_MOVE_DELAY(x)    (x = (x >= MOVE_DELAY_HIGH_SPEED ? x / 2 : x))
+#else
+#define DOUBLE_MOVE_DELAY(x)   (x = (x < MOVE_DELAY_MIN_SPEED ? x * 2 : x))
+#define HALVE_MOVE_DELAY(x)    (x = (x > MOVE_DELAY_MAX_SPEED ? x / 2 : x))
+#endif
 #define DOUBLE_PLAYER_SPEED(p) (HALVE_MOVE_DELAY((p)->move_delay_value))
 #define HALVE_PLAYER_SPEED(p)  (DOUBLE_MOVE_DELAY((p)->move_delay_value))
 
@@ -5314,11 +5322,6 @@ void StartMoving(int x, int y)
     ContinueMoving(x, y);
 }
 
-/* (emacs is confused here for some reason; this makes it happy again ;-) ) */
-void dummy()
-{
-}
-
 void ContinueMoving(int x, int y)
 {
   int element = Feld[x][y];
@@ -7439,12 +7442,25 @@ void AdvanceFrameAndPlayerCounters(int player_nr)
   for (i = 0; i < MAX_PLAYERS; i++)
   {
     boolean advance_player_counters = (player_nr == -1 || player_nr == i);
-    int move_frames =
-      MOVE_DELAY_NORMAL_SPEED /  stored_player[i].move_delay_value;
+    int move_delay_value = stored_player[i].move_delay_value;
+    int move_frames = MOVE_DELAY_NORMAL_SPEED / move_delay_value;
 
     if (!advance_player_counters)      /* not all players may be affected */
       continue;
 
+#if USE_NEW_PLAYER_ANIM
+    if (move_frames == 0)      /* less than one move per game frame */
+    {
+      int stepsize = TILEX / move_delay_value;
+      int delay = move_delay_value / MOVE_DELAY_NORMAL_SPEED;
+      int count = (stored_player[i].is_moving ?
+                  ABS(stored_player[i].MovPos) / stepsize : FrameCounter);
+
+      if (count % delay == 0)
+       move_frames = 1;
+    }
+#endif
+
     stored_player[i].Frame += move_frames;
 
     if (stored_player[i].MovPos != 0)
@@ -7698,11 +7714,20 @@ void GameActions()
     if (IS_CHANGING(x, y) &&
        (game.engine_version < VERSION_IDENT(3,0,7,1) || !Stop[x][y]))
     {
+      int page = element_info[element].event_page_nr[CE_DELAY];
 #if 0
-      ChangeElement(x, y, ChangePage[x][y] != -1 ? ChangePage[x][y] :
-                   element_info[element].event_page_nr[CE_DELAY]);
+      ChangeElement(x, y, ChangePage[x][y] != -1 ? ChangePage[x][y] : page);
 #else
-      ChangeElement(x, y, element_info[element].event_page_nr[CE_DELAY]);
+
+#if 0
+      printf("::: ChangeDelay == %d\n", ChangeDelay[x][y]);
+#endif
+
+      if (CAN_CHANGE(element))
+       ChangeElement(x, y, page);
+
+      if (HAS_ACTION(element) && ChangeDelay[x][y] == 0)
+       ExecuteCustomElementAction(x, y, element, page);
 #endif
 
       element = Feld[x][y];
index d5a370cba4cdbf4a2f2d30964cf047aebaac7570..726d97235fcc11fc6561f4563524f12178309b9f 100644 (file)
@@ -1881,6 +1881,10 @@ void DrawPlayer(struct PlayerInfo *player)
     {
       GfxElement[jx][jy] = EL_UNDEFINED;
 
+      /* make sure that pushed elements are drawn with correct frame rate */
+      if (player->is_pushing && player->is_moving)
+       GfxFrame[jx][jy] = player->StepFrame;
+
       DrawLevelField(jx, jy);
     }
   }
@@ -1930,6 +1934,7 @@ void DrawPlayer(struct PlayerInfo *player)
         player->is_moving, player_is_moving);
 #endif
 
+#if 1
   if (player->is_pushing && player->is_moving)
   {
     int px = SCREENX(jx), py = SCREENY(jy);
@@ -1952,6 +1957,7 @@ void DrawPlayer(struct PlayerInfo *player)
     /* masked drawing is needed for EMC style (double) movement graphics */
     DrawGraphicShiftedThruMask(px, py, pxx, pyy, graphic, frame, NO_CUTTING);
   }
+#endif
 
   /* ----------------------------------------------------------------------- */
   /* draw things in front of player (active dynamite or dynabombs)           */