From: Holger Schemel Date: Mon, 25 Mar 2024 12:43:20 +0000 (+0100) Subject: moved gravity compatibility settings to gravity switch properties page X-Git-Tag: 4.4.0.0-test-1~130 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=737d4e8a0cff8bb6b56b4b8907ee51ea0d1ad415;p=rocksndiamonds.git moved gravity compatibility settings to gravity switch properties page --- diff --git a/src/editor.c b/src/editor.c index e4c9d8a6..afd58ff7 100644 --- a/src/editor.c +++ b/src/editor.c @@ -701,7 +701,6 @@ enum GADGET_ID_BD_LINE_SHIFTING_BORDERS, GADGET_ID_BD_SCAN_FIRST_AND_LAST_ROW, GADGET_ID_BD_SHORT_EXPLOSIONS, - GADGET_ID_BD_GRAVITY_AFFECTS_ALL, GADGET_ID_STICK_ELEMENT, GADGET_ID_EM_SLIPPERY_GEMS, GADGET_ID_EM_EXPLODES_BY_FIRE, @@ -755,6 +754,7 @@ enum GADGET_ID_BD_CREATURES_START_BACKWARDS, GADGET_ID_BD_CREATURES_TURN_ON_HATCHING, GADGET_ID_BD_GRAVITY_SWITCH_ACTIVE, + GADGET_ID_BD_GRAVITY_AFFECTS_ALL, GADGET_ID_ENVELOPE_AUTOWRAP, GADGET_ID_ENVELOPE_CENTERED, GADGET_ID_MM_LASER_RED, @@ -1056,7 +1056,6 @@ enum ED_CHECKBUTTON_ID_BD_LINE_SHIFTING_BORDERS, ED_CHECKBUTTON_ID_BD_SCAN_FIRST_AND_LAST_ROW, ED_CHECKBUTTON_ID_BD_SHORT_EXPLOSIONS, - ED_CHECKBUTTON_ID_BD_GRAVITY_AFFECTS_ALL, ED_CHECKBUTTON_ID_STICK_ELEMENT, ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS, ED_CHECKBUTTON_ID_EM_EXPLODES_BY_FIRE, @@ -1110,6 +1109,7 @@ enum ED_CHECKBUTTON_ID_BD_CREATURES_START_BACKWARDS, ED_CHECKBUTTON_ID_BD_CREATURES_TURN_ON_HATCHING, ED_CHECKBUTTON_ID_BD_GRAVITY_SWITCH_ACTIVE, + ED_CHECKBUTTON_ID_BD_GRAVITY_AFFECTS_ALL, ED_CHECKBUTTON_ID_ENVELOPE_AUTOWRAP, ED_CHECKBUTTON_ID_ENVELOPE_CENTERED, ED_CHECKBUTTON_ID_MM_LASER_RED, @@ -1159,7 +1159,7 @@ enum #define ED_CHECKBUTTON_ID_EDITOR_LAST ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE_2 #define ED_CHECKBUTTON_ID_ENGINE_FIRST ED_CHECKBUTTON_ID_BD_INTERMISSION -#define ED_CHECKBUTTON_ID_ENGINE_LAST ED_CHECKBUTTON_ID_BD_GRAVITY_AFFECTS_ALL +#define ED_CHECKBUTTON_ID_ENGINE_LAST ED_CHECKBUTTON_ID_BD_SHORT_EXPLOSIONS #define ED_CHECKBUTTON_ID_CUSTOM1_FIRST ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC #define ED_CHECKBUTTON_ID_CUSTOM1_LAST ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE @@ -3518,14 +3518,6 @@ static struct NULL, NULL, "Short explosions", "Use four game cycles for explosions" }, - { - ED_CHECKBUTTON_ID_BD_GRAVITY_AFFECTS_ALL, - ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(9), - GADGET_ID_BD_GRAVITY_AFFECTS_ALL, GADGET_ID_NONE, - &level.bd_gravity_affects_all, - NULL, NULL, - "Gravity change affects everything", "Gravity affects all falling objects" - }, // ---------- element settings: configure (various elements) ---------------- @@ -3953,6 +3945,14 @@ static struct NULL, NULL, "Gravity switch active at start", "Gravity switch starts in active state" }, + { + ED_CHECKBUTTON_ID_BD_GRAVITY_AFFECTS_ALL, + ED_LEVEL_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(3), + GADGET_ID_BD_GRAVITY_AFFECTS_ALL, GADGET_ID_NONE, + &level.bd_gravity_affects_all, + NULL, NULL, + "Gravity change affects everything", "Gravity affects all falling objects" + }, { ED_CHECKBUTTON_ID_ENVELOPE_AUTOWRAP, ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1), @@ -12015,6 +12015,7 @@ static void DrawPropertiesConfig(void) MapSelectboxGadget(ED_SELECTBOX_ID_BD_GRAVITY_DIRECTION); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_GRAVITY_SWITCH_ACTIVE); + MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_GRAVITY_AFFECTS_ALL); } if (properties_element == EL_BD_NUT) diff --git a/src/files.c b/src/files.c index b405986f..92dfbcea 100644 --- a/src/files.c +++ b/src/files.c @@ -307,12 +307,7 @@ static struct LevelFileConfigInfo chunk_config_INFO[] = }, { -1, -1, - TYPE_BOOLEAN, CONF_VALUE_8_BIT(23), - &li.bd_gravity_affects_all, TRUE - }, - { - -1, -1, - TYPE_INTEGER, CONF_VALUE_8_BIT(24), + TYPE_INTEGER, CONF_VALUE_8_BIT(23), &li.bd_cave_random_seed_c64, 0 }, @@ -910,6 +905,11 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] = TYPE_INTEGER, CONF_VALUE_8_BIT(3), &li.bd_gravity_switch_delay, 10 }, + { + EL_BD_GRAVITY_SWITCH, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(4), + &li.bd_gravity_affects_all, TRUE + }, { EL_BD_SAND, -1, @@ -4160,7 +4160,6 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level) cave->lineshift = level->bd_line_shifting_borders; cave->border_scan_first_and_last = level->bd_scan_first_and_last_row; cave->short_explosions = level->bd_short_explosions; - cave->gravity_affects_all = level->bd_gravity_affects_all; // player properties cave->diagonal_movements = level->bd_diagonal_movements; @@ -4259,6 +4258,7 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level) cave->gravity = level->bd_gravity_direction; cave->gravity_switch_active = level->bd_gravity_switch_active; cave->gravity_change_time = level->bd_gravity_switch_delay; + cave->gravity_affects_all = level->bd_gravity_affects_all; // level name strncpy(cave->name, level->name, sizeof(GdString)); @@ -4304,7 +4304,6 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level) level->bd_line_shifting_borders = cave->lineshift; level->bd_scan_first_and_last_row = cave->border_scan_first_and_last; level->bd_short_explosions = cave->short_explosions; - level->bd_gravity_affects_all = cave->gravity_affects_all; // player properties level->bd_diagonal_movements = cave->diagonal_movements; @@ -4403,6 +4402,7 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level) level->bd_gravity_direction = cave->gravity; level->bd_gravity_switch_active = cave->gravity_switch_active; level->bd_gravity_switch_delay = cave->gravity_change_time; + level->bd_gravity_affects_all = cave->gravity_affects_all; // level name char *cave_name = getStringPrint("%s / %d", cave->name, bd_level_nr + 1); diff --git a/src/main.h b/src/main.h index 57ce9d12..0a5f1471 100644 --- a/src/main.h +++ b/src/main.h @@ -3612,7 +3612,6 @@ struct LevelInfo boolean bd_line_shifting_borders; // BD engine uses line-shifting wrap-around boolean bd_scan_first_and_last_row; // BD engine scans top and bottom border rows boolean bd_short_explosions; // BD engine uses four game cycles for explosions - boolean bd_gravity_affects_all; // BD engine gravity affects all falling objects boolean bd_intermission; // BD level is intermission boolean bd_diagonal_movements; // BD style diagonal movements boolean bd_topmost_player_active; // BD engine uses first player found on playfield @@ -3690,6 +3689,7 @@ struct LevelInfo int bd_gravity_direction; // BD engine initial gravity direction boolean bd_gravity_switch_active; // BD engine gravity switch starts in active state int bd_gravity_switch_delay; // BD engine gravity change delay for switch (in seconds) + boolean bd_gravity_affects_all; // BD engine gravity affects all falling objects boolean em_slippery_gems; // EM style "gems slip from wall" behaviour boolean em_explodes_by_fire; // EM style chain explosion behaviour