From: Holger Schemel Date: Wed, 10 Apr 2024 22:43:38 +0000 (+0200) Subject: added setup option to always play native BD caves with random colors X-Git-Tag: 4.4.0.0-test-1~73 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=88649b249ef0485f6c6233dfee03e3cae1eefa1f;p=rocksndiamonds.git added setup option to always play native BD caves with random colors --- diff --git a/src/files.c b/src/files.c index 2694c2d9..ec25f0b2 100644 --- a/src/files.c +++ b/src/files.c @@ -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; diff --git a/src/game_bd/bd_gameplay.c b/src/game_bd/bd_gameplay.c index 55905ec6..b287f085 100644 --- a/src/game_bd/bd_gameplay.c +++ b/src/game_bd/bd_gameplay.c @@ -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); diff --git a/src/libgame/system.h b/src/libgame/system.h index fddb72ad..78392d89 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -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; diff --git a/src/screens.c b/src/screens.c index 7098002c..2a44ae7b 100644 --- a/src/screens.c +++ b/src/screens.c @@ -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:" },