added setup option to always play native BD caves with random colors
authorHolger Schemel <info@artsoft.org>
Wed, 10 Apr 2024 22:43:38 +0000 (00:43 +0200)
committerHolger Schemel <info@artsoft.org>
Wed, 10 Apr 2024 22:43:42 +0000 (00:43 +0200)
src/files.c
src/game_bd/bd_gameplay.c
src/libgame/system.h
src/screens.c

index 2694c2d9a71cecb946c02e882bc9944300600f66..ec25f0b25ba0852ebf92261e9e4cbc889105193f 100644 (file)
@@ -10791,6 +10791,10 @@ static struct TokenInfo global_setup_tokens[] =
     TYPE_INTEGER,
     &setup.bd_default_color_type,              "bd_default_color_type"
   },
+  {
+    TYPE_SWITCH,
+    &setup.bd_random_colors,                   "bd_random_colors"
+  },
   {
     TYPE_SWITCH,
     &setup.sp_show_border_elements,            "sp_show_border_elements"
@@ -11620,6 +11624,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si)
   si->bd_palette_c64dtv = GD_DEFAULT_PALETTE_C64DTV;
   si->bd_palette_atari = GD_DEFAULT_PALETTE_ATARI;
   si->bd_default_color_type = GD_DEFAULT_COLOR_TYPE;
+  si->bd_random_colors = FALSE;
   si->sp_show_border_elements = FALSE;
   si->small_game_graphics = FALSE;
   si->show_load_save_buttons = FALSE;
index 55905ec6961f9355387ab2ad81cfa3ac0c1dcb06..b287f085be9a68b4705c925654bdd7a327e88cfd 100644 (file)
@@ -116,6 +116,10 @@ static void load_cave(GdGame *game)
 
   game->cave = gd_get_prepared_cave(game->original_cave, game->level_num);
 
+  // if requested, recolor cave (cave is a copy only, so no worries)
+  if (setup.bd_random_colors)
+    gd_cave_set_random_colors(game->cave, setup.bd_default_color_type);
+
   if (game->cave->intermission && game->cave->intermission_instantlife)
     add_bonus_life(game, FALSE);
 
index fddb72add6cc7ed9c02417d3aa63157ca5524b1f..78392d89f535e992a941071151c04ff23263b132 100644 (file)
@@ -1520,6 +1520,7 @@ struct SetupInfo
   int bd_palette_c64dtv;
   int bd_palette_atari;
   int bd_default_color_type;
+  int bd_random_colors;
   boolean sp_show_border_elements;
   boolean small_game_graphics;
   boolean show_load_save_buttons;
index 7098002cb4fa76d1ceecf6affc90d8015998b08b..2a44ae7b60a3f376fcc1919b1439f44fa0458244 100644 (file)
@@ -7981,6 +7981,7 @@ static struct TokenInfo setup_info_engines[] =
   { TYPE_STRING,       &bd_palette_atari_text,         ""                              },
   { TYPE_ENTER_LIST,   &execSetupChooseColorType,      "Preferred Color Type:"         },
   { TYPE_STRING,       &bd_color_type_text,            ""                              },
+  { TYPE_SWITCH,       &setup.bd_random_colors,        "Random Colors:"                },
   { TYPE_EMPTY,                NULL,                           ""                              },
   { TYPE_HEADLINE,     NULL,                           "Emerald Mine"                  },
   { TYPE_SWITCH,       &setup.forced_scroll_delay,     "Scroll Delay:"                 },