added setup option to enable smooth element movement for BD engine
authorHolger Schemel <info@artsoft.org>
Sat, 17 Feb 2024 14:31:05 +0000 (15:31 +0100)
committerHolger Schemel <info@artsoft.org>
Sun, 18 Feb 2024 15:17:01 +0000 (16:17 +0100)
src/files.c
src/game_bd/bd_graphics.c
src/libgame/system.h
src/screens.c

index aea943a5d5a0288f929bf99490f0892f981439e3..7b851893f1ab6eea1d5cd808fade44b29f72da5b 100644 (file)
@@ -9817,6 +9817,10 @@ static struct TokenInfo global_setup_tokens[] =
     TYPE_SWITCH,
     &setup.bd_scroll_delay,                    "bd_scroll_delay"
   },
+  {
+    TYPE_SWITCH3,
+    &setup.bd_smooth_movements,                        "bd_smooth_movements"
+  },
   {
     TYPE_SWITCH,
     &setup.sp_show_border_elements,            "sp_show_border_elements"
@@ -10636,6 +10640,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si)
   si->bd_skip_uncovering = FALSE;
   si->bd_skip_hatching = FALSE;
   si->bd_scroll_delay = TRUE;
+  si->bd_smooth_movements = AUTO;
   si->sp_show_border_elements = FALSE;
   si->small_game_graphics = FALSE;
   si->show_load_save_buttons = FALSE;
index ac84de400c9329c275e06d9ceae1e02364e9153f..b88f5bdb3ebbfefc15037f8e87d948228adb5349 100644 (file)
@@ -318,7 +318,9 @@ 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()));
 
 #if DO_GFX_SANITY_CHECK
   if (use_native_bd_graphics_engine() && !setup.small_game_graphics && !program.headless)
index 9bdab6c3a720c29d1e82bff8c21b43a0db63ec21..cc17c73019d5ea21027cd234fb99c8a3ed465bfd 100644 (file)
@@ -1512,6 +1512,7 @@ struct SetupInfo
   boolean bd_skip_uncovering;
   boolean bd_skip_hatching;
   boolean bd_scroll_delay;
+  int bd_smooth_movements;             // not boolean -- can also be "AUTO"
   boolean sp_show_border_elements;
   boolean small_game_graphics;
   boolean show_load_save_buttons;
index 54236dc840a8b1ff174ba99a153c986e6c5ec2ec..e14114ee2e05fa33a719a602ce0ec70280636dbf 100644 (file)
@@ -7469,6 +7469,7 @@ static struct TokenInfo setup_info_engines[] =
   { TYPE_SWITCH,       &setup.bd_skip_uncovering,      "Skip (un)covering screen:"     },
   { TYPE_SWITCH,       &setup.bd_skip_hatching,        "Skip hatching player:"         },
   { TYPE_SWITCH,       &setup.bd_scroll_delay,         "Scroll Delay:"                 },
+  { TYPE_YES_NO_AUTO,  &setup.bd_smooth_movements,     "Smooth Element Movement:"      },
   { TYPE_EMPTY,                NULL,                           ""                              },
   { TYPE_HEADLINE,     NULL,                           "Emerald Mine"                  },
   { TYPE_SWITCH,       &setup.forced_scroll_delay,     "Scroll Delay:"                 },