disabled smooth movement for player entering exit in BD engine
[rocksndiamonds.git] / src / game_bd / bd_graphics.c
index 22851bdd8c0840996b7e48234e7e3e7a7f6967ab..62981ec8dafccc0045cae1065122355335c433aa 100644 (file)
@@ -216,6 +216,9 @@ boolean gd_scroll(GdGame *game, boolean exact_scroll, boolean immediate)
   /* caught up with the desired position. smaller is better. */
   int scroll_speed = cell_size * 20 / game->cave->speed;
 
+  if (!setup.bd_scroll_delay)
+    exact_scroll = TRUE;
+
   if (immediate)
     scroll_speed = cell_size * MAX(game->cave->w, game->cave->h);
 
@@ -304,6 +307,12 @@ static inline boolean is_collectible(const int element)
   return (gd_elements[element & O_MASK].properties & P_COLLECTIBLE) != 0;
 }
 
+/* returns true if the element is exploding */
+static inline boolean is_explosion(const int element)
+{
+  return (gd_elements[element & O_MASK].properties & P_EXPLOSION) != 0;
+}
+
 static void gd_drawcave_tile(Bitmap *dest, GdGame *game, int x, int y, boolean draw_masked)
 {
   void (*blit_bitmap)(Bitmap *, Bitmap *, int, int, int, int, int, int) =
@@ -315,7 +324,17 @@ static void gd_drawcave_tile(Bitmap *dest, GdGame *game, int x, int y, boolean d
   int tile = game->element_buffer[y][x];
   int frame = game->animcycle;
   struct GraphicInfo_BD *g = &graphic_info_bd_object[tile][frame];
-  boolean use_smooth_movements = TRUE;
+  boolean use_smooth_movements =
+    ((setup.bd_smooth_movements == TRUE) ||
+     (setup.bd_smooth_movements == AUTO && !use_native_bd_graphics_engine()));
+
+  // do not use smooth movement animation for exploding game elements (like player)
+  if (is_explosion(tile) && dir != GD_MV_STILL)
+    use_smooth_movements = FALSE;
+
+  // do not use smooth movement animation for player entering exit (engine stopped)
+  if (cave->player_state == GD_PL_EXITED)
+    use_smooth_movements = FALSE;
 
 #if DO_GFX_SANITY_CHECK
   if (use_native_bd_graphics_engine() && !setup.small_game_graphics && !program.headless)