added setup option to disable delayed scrolling for BD engine
authorHolger Schemel <info@artsoft.org>
Sat, 17 Feb 2024 13:57:59 +0000 (14:57 +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 a81a3f060eb5fb6c779404a29da9c2e9f1569326..aea943a5d5a0288f929bf99490f0892f981439e3 100644 (file)
@@ -9813,6 +9813,10 @@ static struct TokenInfo global_setup_tokens[] =
     TYPE_SWITCH,
     &setup.bd_skip_hatching,                   "bd_skip_hatching"
   },
+  {
+    TYPE_SWITCH,
+    &setup.bd_scroll_delay,                    "bd_scroll_delay"
+  },
   {
     TYPE_SWITCH,
     &setup.sp_show_border_elements,            "sp_show_border_elements"
@@ -10631,6 +10635,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si)
   si->game_frame_delay = GAME_FRAME_DELAY;
   si->bd_skip_uncovering = FALSE;
   si->bd_skip_hatching = FALSE;
+  si->bd_scroll_delay = TRUE;
   si->sp_show_border_elements = FALSE;
   si->small_game_graphics = FALSE;
   si->show_load_save_buttons = FALSE;
index 22851bdd8c0840996b7e48234e7e3e7a7f6967ab..ac84de400c9329c275e06d9ceae1e02364e9153f 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);
 
index 77f3413123c4f92a9cb2b37d0b620a2a41741745..9bdab6c3a720c29d1e82bff8c21b43a0db63ec21 100644 (file)
@@ -1511,6 +1511,7 @@ struct SetupInfo
   int game_frame_delay;
   boolean bd_skip_uncovering;
   boolean bd_skip_hatching;
+  boolean bd_scroll_delay;
   boolean sp_show_border_elements;
   boolean small_game_graphics;
   boolean show_load_save_buttons;
index 9d4157c026829febf36f9ee8fa325dec8f31abd5..54236dc840a8b1ff174ba99a153c986e6c5ec2ec 100644 (file)
@@ -7468,6 +7468,7 @@ static struct TokenInfo setup_info_engines[] =
   { TYPE_HEADLINE,     NULL,                           "Boulder Dash"                  },
   { 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_EMPTY,                NULL,                           ""                              },
   { TYPE_HEADLINE,     NULL,                           "Emerald Mine"                  },
   { TYPE_SWITCH,       &setup.forced_scroll_delay,     "Scroll Delay:"                 },