changed functions to check smooth movements in BD engine
authorHolger Schemel <info@artsoft.org>
Sun, 14 Apr 2024 18:22:34 +0000 (20:22 +0200)
committerHolger Schemel <info@artsoft.org>
Sun, 14 Apr 2024 18:22:34 +0000 (20:22 +0200)
src/game_bd/bd_graphics.c
src/game_bd/export_bd.h
src/game_bd/main_bd.c

index 635e21f61b09b7fe153cb5af15067f30e81189ad..302dddbb87044dd888ed52706b6860aa53a09a91 100644 (file)
@@ -530,12 +530,6 @@ Bitmap *gd_get_tile_bitmap(Bitmap *bitmap)
   return bitmap;
 }
 
-// workaround to prevent variable name scope problem
-static boolean use_native_bd_graphics_engine(void)
-{
-  return game.use_native_bd_graphics_engine;
-}
-
 // returns true if the element is a player
 static inline boolean is_player(const int element)
 {
@@ -593,9 +587,7 @@ static void gd_drawcave_tile(Bitmap *dest, GdGame *game, int x, int y, boolean d
   boolean is_movable = (can_move(tile) || can_fall(tile) || is_pushable(tile) || is_player(tile));
   boolean is_movable_or_diggable = (is_movable || is_diggable(game->last_element_buffer[y][x]));
   boolean is_moving = (is_movable_or_diggable && dir != GD_MV_STILL);
-  boolean use_smooth_movements =
-    ((setup.bd_smooth_movements == TRUE) ||
-     (setup.bd_smooth_movements == AUTO && !use_native_bd_graphics_engine()));
+  boolean use_smooth_movements = use_bd_smooth_movements();
 
   // do not use smooth movement animation for exploding game elements (like player)
   if (is_explosion(tile) && dir != GD_MV_STILL)
index 688d506ef9072309a2c8537c18687dd8e2876ed3..b7d624676f66712213de80fe14fd9df0cdc0a6cd 100644 (file)
@@ -112,6 +112,9 @@ unsigned int InitEngineRandom_BD(int);
 void InitGameEngine_BD(void);
 void GameActions_BD(byte[MAX_PLAYERS]);
 
+boolean use_native_bd_graphics_engine(void);
+boolean use_bd_smooth_movements(void);
+
 Bitmap **GetTitleScreenBitmaps_BD(void);
 void CoverScreen_BD(void);
 
index f6d60f6ea39538ca30bcfb8e057c23160f5d9f6c..c734d5ea0990875a1b87402c673c073eb374acc4 100644 (file)
@@ -433,6 +433,19 @@ void GameActions_BD(byte action[MAX_PLAYERS])
 // graphics functions
 // ============================================================================
 
+// check if native BD graphics engine requested in custom graphics configuration
+boolean use_native_bd_graphics_engine(void)
+{
+  return game.use_native_bd_graphics_engine;
+}
+
+// check if smooth game element movements selected in setup menu
+boolean use_bd_smooth_movements(void)
+{
+  return ((setup.bd_smooth_movements == TRUE) ||
+         (setup.bd_smooth_movements == AUTO && !use_native_bd_graphics_engine()));
+}
+
 Bitmap **GetTitleScreenBitmaps_BD(void)
 {
   Bitmap **title_screen_bitmaps = gd_get_title_screen_bitmaps();