X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ffiles.c;h=85bc18351de901a25a5de9024c854f6e7eaf741a;hb=4b979559210bd4da7da9d6c94643823748df23ae;hp=25943b63f123b597870bcc4a56141b6d48997023;hpb=ee96a7b4c9e63388cf63ede2d935af2c427db5a9;p=rocksndiamonds.git diff --git a/src/files.c b/src/files.c index 25943b63..85bc1835 100644 --- a/src/files.c +++ b/src/files.c @@ -19,6 +19,7 @@ #include "files.h" #include "init.h" #include "screens.h" +#include "editor.h" #include "tools.h" #include "tape.h" #include "config.h" @@ -310,6 +311,41 @@ static struct LevelFileConfigInfo chunk_config_INFO[] = TYPE_INTEGER, CONF_VALUE_8_BIT(23), &li.bd_cave_random_seed_c64, 0 }, + { + -1, -1, + TYPE_INTEGER, CONF_VALUE_32_BIT(3), + &li.bd_color_b, GD_C64_COLOR(0) + }, + { + -1, -1, + TYPE_INTEGER, CONF_VALUE_32_BIT(4), + &li.bd_color_0, GD_C64_COLOR(0) + }, + { + -1, -1, + TYPE_INTEGER, CONF_VALUE_32_BIT(5), + &li.bd_color_1, GD_C64_COLOR(8) + }, + { + -1, -1, + TYPE_INTEGER, CONF_VALUE_32_BIT(6), + &li.bd_color_2, GD_C64_COLOR(11) + }, + { + -1, -1, + TYPE_INTEGER, CONF_VALUE_32_BIT(7), + &li.bd_color_3, GD_C64_COLOR(1) + }, + { + -1, -1, + TYPE_INTEGER, CONF_VALUE_32_BIT(8), + &li.bd_color_4, GD_C64_COLOR(5) + }, + { + -1, -1, + TYPE_INTEGER, CONF_VALUE_32_BIT(9), + &li.bd_color_5, GD_C64_COLOR(6) + }, { -1, -1, @@ -742,6 +778,11 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] = TYPE_BOOLEAN, CONF_VALUE_8_BIT(3), &li.bd_magic_wall_zero_infinite, TRUE }, + { + EL_BD_MAGIC_WALL, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(4), + &li.bd_magic_wall_break_scan, FALSE + }, { EL_BD_MAGIC_WALL, -1, TYPE_ELEMENT, CONF_VALUE_16_BIT(1), @@ -2341,6 +2382,10 @@ static void setLevelInfoToDefaults_Level(struct LevelInfo *level) // detect custom elements when loading them level->file_has_custom_elements = FALSE; + // set default color type and colors for BD style level colors + SetDefaultLevelColorType_BD(); + SetDefaultLevelColors_BD(); + // set all bug compatibility flags to "false" => do not emulate this bug level->use_action_after_change_bug = FALSE; @@ -4272,6 +4317,7 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level) cave->magic_timer_zero_is_infinite = level->bd_magic_wall_zero_infinite; cave->magic_timer_wait_for_hatching = level->bd_magic_wall_wait_hatching; cave->magic_wall_stops_amoeba = level->bd_magic_wall_stops_amoeba; + cave->magic_wall_breakscan = level->bd_magic_wall_break_scan; cave->magic_diamond_to = LEVEL_TO_CAVE(level->bd_magic_wall_diamond_to); cave->magic_stone_to = LEVEL_TO_CAVE(level->bd_magic_wall_rock_to); @@ -4372,6 +4418,14 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level) cave->nitro_explosion_effect = LEVEL_TO_CAVE(level->bd_nitro_explosion_turns_to); cave->explosion_effect = LEVEL_TO_CAVE(level->bd_explosion_turns_to); + cave->colorb = level->bd_color_b; + cave->color0 = level->bd_color_0; + cave->color1 = level->bd_color_1; + cave->color2 = level->bd_color_2; + cave->color3 = level->bd_color_3; + cave->color4 = level->bd_color_4; + cave->color5 = level->bd_color_5; + // level name strncpy(cave->name, level->name, sizeof(GdString)); cave->name[sizeof(GdString) - 1] = '\0'; @@ -4436,6 +4490,7 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level) level->bd_magic_wall_zero_infinite = cave->magic_timer_zero_is_infinite; level->bd_magic_wall_wait_hatching = cave->magic_timer_wait_for_hatching; level->bd_magic_wall_stops_amoeba = cave->magic_wall_stops_amoeba; + level->bd_magic_wall_break_scan = cave->magic_wall_breakscan; level->bd_magic_wall_diamond_to = CAVE_TO_LEVEL(cave->magic_diamond_to); level->bd_magic_wall_rock_to = CAVE_TO_LEVEL(cave->magic_stone_to); @@ -4536,6 +4591,18 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level) level->bd_nitro_explosion_turns_to = CAVE_TO_LEVEL(cave->nitro_explosion_effect); level->bd_explosion_turns_to = CAVE_TO_LEVEL(cave->explosion_effect); + level->bd_color_b = cave->colorb; + level->bd_color_0 = cave->color0; + level->bd_color_1 = cave->color1; + level->bd_color_2 = cave->color2; + level->bd_color_3 = cave->color3; + level->bd_color_4 = cave->color4; + level->bd_color_5 = cave->color5; + + // set default color type and colors for BD style level colors + SetDefaultLevelColorType_BD(); + SetDefaultLevelColors_BD(); + // level name char *cave_name = getStringPrint("%s / %d", cave->name, bd_level_nr + 1);