moved gravity compatibility settings to gravity switch properties page
authorHolger Schemel <info@artsoft.org>
Mon, 25 Mar 2024 12:43:20 +0000 (13:43 +0100)
committerHolger Schemel <info@artsoft.org>
Mon, 25 Mar 2024 14:33:21 +0000 (15:33 +0100)
src/editor.c
src/files.c
src/main.h

index e4c9d8a66de5c1022e37ab1344b15a53db090153..afd58ff71e95ae4a7c840d67a832edb98cb34842 100644 (file)
@@ -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)
index b405986f92cbb27ad077924c8d6d57b38aed4028..92dfbcea9b7ebc18830aa2628c37e3574a3ab752 100644 (file)
@@ -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);
index 57ce9d12dfcf7b2048be39dc2786d9346a963ddd..0a5f1471e5790d1aa7331a2dbe26f2a2d7ebcc13 100644 (file)
@@ -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