added storing 2nd last BD player movement direction (not used yet)
authorHolger Schemel <holger.schemel@virtion.de>
Sat, 11 Jan 2025 19:10:46 +0000 (20:10 +0100)
committerHolger Schemel <holger.schemel@virtion.de>
Sat, 11 Jan 2025 19:15:01 +0000 (20:15 +0100)
src/game_bd/bd_cave.h
src/game_bd/bd_caveengine.c
src/game_bd/bd_caveobject.c

index f76c215b9363b45a502d3cd571a7f7a0ed6530ae..6284d556ac4ea8b23e79a1c3158fa3dbec49e460 100644 (file)
@@ -642,6 +642,7 @@ typedef struct _gd_cave
   boolean inbox_flash_toggle;           // negated every scan. helps drawing inboxes, and making
                                         // players be born at different times.
   GdDirection last_direction;           // last direction player moved. used by draw routines
+  GdDirection last_direction_2nd;       // 2nd last direction player moved. used by draw routines
   GdDirection last_horizontal_direction;
   int biters_wait_frame;                // number of frames to wait until biters will move again
   int replicators_wait_frame;           // number of frames to wait until replicators are
index ba4aa4c88df7aea180d8390c2951ca276ce2f8fc..7e79685e4ccec6f336c3d9b57541c184eee82f6d 100644 (file)
@@ -4392,6 +4392,7 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire,
 #endif
 
   // set these for drawing.
+  cave->last_direction_2nd = cave->last_direction;
   cave->last_direction = player_move;
 
   // here we remember last movements for animation. this is needed here, as animation
index ab9551b0ee41ae5d3a7f6f6fbd54138d9b06a5d7..19f3b91c9c2641bfc17d152a34e95495211bcf92 100644 (file)
@@ -1585,6 +1585,7 @@ GdCave *gd_cave_new_rendered(const GdCave *data, const int level, const unsigned
   gd_cave_correct_visible_size(cave);
 
   cave->last_direction = GD_MV_STILL;
+  cave->last_direction_2nd = GD_MV_STILL;
   cave->last_horizontal_direction = GD_MV_STILL;
 
   // list of cave variables for effects that can create other game elements