From: Holger Schemel Date: Sat, 9 Mar 2024 11:51:07 +0000 (+0100) Subject: added support for scheduling type in BD engine to level editor X-Git-Tag: 4.4.0.0-test-1~220 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=28f12e15d6cc932d5c2b6ae5a621fa024f3a1a2b;p=rocksndiamonds.git added support for scheduling type in BD engine to level editor --- diff --git a/src/editor.c b/src/editor.c index 1cdf04d2..bd1e70bb 100644 --- a/src/editor.c +++ b/src/editor.c @@ -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) diff --git a/src/files.c b/src/files.c index b8ef4481..62069398 100644 --- a/src/files.c +++ b/src/files.c @@ -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; diff --git a/src/main.h b/src/main.h index 06be311c..18479583 100644 --- a/src/main.h +++ b/src/main.h @@ -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