added support for scheduling type in BD engine to level editor
authorHolger Schemel <info@artsoft.org>
Sat, 9 Mar 2024 11:51:07 +0000 (12:51 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 9 Mar 2024 11:51:09 +0000 (12:51 +0100)
src/editor.c
src/files.c
src/main.h

index 1cdf04d22af28da74faf22a3c72eb023091bdcbc..bd1e70bbae8d4449fe690425faf16935167f314a 100644 (file)
@@ -571,6 +571,7 @@ enum
   GADGET_ID_TIME_OR_STEPS,
   GADGET_ID_TIME_SCORE_BASE,
   GADGET_ID_GAME_ENGINE_TYPE,
+  GADGET_ID_BD_SCHEDULING_TYPE,
   GADGET_ID_LEVELSET_SAVE_MODE,
   GADGET_ID_WIND_DIRECTION,
   GADGET_ID_PLAYER_SPEED,
@@ -865,6 +866,7 @@ enum
   ED_SELECTBOX_ID_TIME_OR_STEPS,
   ED_SELECTBOX_ID_TIME_SCORE_BASE,
   ED_SELECTBOX_ID_GAME_ENGINE_TYPE,
+  ED_SELECTBOX_ID_BD_SCHEDULING_TYPE,
   ED_SELECTBOX_ID_LEVELSET_SAVE_MODE,
   ED_SELECTBOX_ID_WIND_DIRECTION,
   ED_SELECTBOX_ID_PLAYER_SPEED,
@@ -904,6 +906,9 @@ enum
 #define ED_SELECTBOX_ID_LEVELSET_FIRST ED_SELECTBOX_ID_LEVELSET_SAVE_MODE
 #define ED_SELECTBOX_ID_LEVELSET_LAST  ED_SELECTBOX_ID_LEVELSET_SAVE_MODE
 
+#define ED_SELECTBOX_ID_ENGINE_FIRST   ED_SELECTBOX_ID_BD_SCHEDULING_TYPE
+#define ED_SELECTBOX_ID_ENGINE_LAST    ED_SELECTBOX_ID_BD_SCHEDULING_TYPE
+
 #define ED_SELECTBOX_ID_CUSTOM1_FIRST  ED_SELECTBOX_ID_CUSTOM_ACCESS_TYPE
 #define ED_SELECTBOX_ID_CUSTOM1_LAST   ED_SELECTBOX_ID_CUSTOM_WALK_TO_ACTION
 #define ED_SELECTBOX_ID_CUSTOM2_FIRST  ED_SELECTBOX_ID_CUSTOM_MOVE_PATTERN
@@ -2530,6 +2535,19 @@ static struct ValueTextInfo options_group_choice_mode[] =
   { -1,                                NULL                            }
 };
 
+static struct ValueTextInfo options_bd_scheduling_type[] =
+{
+  { GD_SCHEDULING_MILLISECONDS,        "Milliseconds"                  },
+  { GD_SCHEDULING_BD1,         "BD1"                           },
+  { GD_SCHEDULING_BD2,         "BD2"                           },
+  { GD_SCHEDULING_PLCK,                "Construction Kit"              },
+  { GD_SCHEDULING_CRDR,                "Crazy Dream 7"                 },
+  { GD_SCHEDULING_BD1_ATARI,   "Atari BD1"                     },
+  { GD_SCHEDULING_BD2_PLCK_ATARI,"Atari BD2 / PLCK"            },
+
+  { -1,                                NULL                            }
+};
+
 static struct ValueTextInfo *action_arg_modes[] =
 {
   options_action_mode_none,
@@ -2613,6 +2631,15 @@ static struct
     &level.game_engine_type,
     NULL, "game engine:", NULL,                "game engine"
   },
+  {
+    ED_SELECTBOX_ID_BD_SCHEDULING_TYPE,
+    ED_LEVEL_SETTINGS_XPOS(0),         ED_LEVEL_SETTINGS_YPOS(1),
+    GADGET_ID_BD_SCHEDULING_TYPE,      GADGET_ID_NONE,
+    -1,
+    options_bd_scheduling_type,
+    &level.bd_scheduling_type,
+    NULL, "scheduling type:", NULL,    "level timing"
+  },
   {
     ED_SELECTBOX_ID_LEVELSET_SAVE_MODE,
     ED_LEVEL_SETTINGS_XPOS(0),         ED_LEVEL_SETTINGS_YPOS(10),
@@ -3258,7 +3285,7 @@ static struct
   },
   {
     ED_CHECKBUTTON_ID_BD_PAL_TIMING,
-    ED_LEVEL_SETTINGS_XPOS(0),         ED_LEVEL_SETTINGS_YPOS(1),
+    ED_LEVEL_SETTINGS_XPOS(0),         ED_LEVEL_SETTINGS_YPOS(2),
     GADGET_ID_BD_PAL_TIMING,           GADGET_ID_NONE,
     &level.bd_pal_timing,
     NULL, NULL,
@@ -10020,6 +10047,10 @@ static void DrawLevelConfigEngine(void)
   // draw checkbutton gadgets
   for (i = ED_CHECKBUTTON_ID_ENGINE_FIRST; i <= ED_CHECKBUTTON_ID_ENGINE_LAST; i++)
     MapCheckbuttonGadget(i);
+
+  // draw selectbox gadgets
+  for (i = ED_SELECTBOX_ID_ENGINE_FIRST; i <= ED_SELECTBOX_ID_ENGINE_LAST; i++)
+    MapSelectboxGadget(i);
 }
 
 static void DrawLevelConfigWindow(void)
index b8ef44816658da29e093e0b49b72ab26afe99eae..62069398a849b7b5aa877e95ead9b6a120ee4db1 100644 (file)
@@ -281,7 +281,13 @@ static struct LevelFileConfigInfo chunk_config_INFO[] =
 
   {
     -1,                                        -1,
-    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(15),
+    TYPE_INTEGER,                      CONF_VALUE_8_BIT(15),
+    &li.bd_scheduling_type,            GD_SCHEDULING_MILLISECONDS
+  },
+
+  {
+    -1,                                        -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(16),
     &li.bd_pal_timing,                 FALSE
   },
 
@@ -3729,6 +3735,7 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level)
 
   cave->level_speed[0]                 = 160;  // set cave speed
 
+  cave->scheduling                     = level->bd_scheduling_type;
   cave->pal_timing                     = level->bd_pal_timing;
   cave->intermission                   = level->bd_intermission;
   cave->diagonal_movements             = level->bd_diagonal_movements;
@@ -3759,6 +3766,7 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level)
   level->score[SC_EMERALD]             = cave->diamond_value;
   level->score[SC_DIAMOND_EXTRA]       = cave->extra_diamond_value;
 
+  level->bd_scheduling_type            = cave->scheduling;
   level->bd_pal_timing                 = cave->pal_timing;
   level->bd_intermission               = cave->intermission;
   level->bd_diagonal_movements         = cave->diagonal_movements;
index 06be311c4782b4558b1870865b4a59652abe5e5d..18479583a49caf67063c72bed6eb8f87b1cef332 100644 (file)
@@ -3480,6 +3480,7 @@ struct LevelInfo
   int initial_inventory_size[MAX_PLAYERS];
   int initial_inventory_content[MAX_PLAYERS][MAX_INITIAL_INVENTORY_SIZE];
 
+  boolean bd_scheduling_type;          // BD engine scheduling type
   boolean bd_pal_timing;               // BD engine special timing
   boolean bd_intermission;             // BD level is intermission
   boolean bd_diagonal_movements;       // BD style diagonal movements