From: Holger Schemel Date: Sun, 10 Mar 2024 15:14:26 +0000 (+0100) Subject: added support for hatching delay in BD engine to level editor X-Git-Tag: 4.4.0.0-test-1~216 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=2ab201bba336de7c14a297519a17d8979ca08783;p=rocksndiamonds.git added support for hatching delay in BD engine to level editor --- diff --git a/src/editor.c b/src/editor.c index c5b1b4a7..6d8bd174 100644 --- a/src/editor.c +++ b/src/editor.c @@ -435,6 +435,12 @@ enum GADGET_ID_BD_CYCLE_DELAY_C64_DOWN, GADGET_ID_BD_CYCLE_DELAY_C64_TEXT, GADGET_ID_BD_CYCLE_DELAY_C64_UP, + GADGET_ID_BD_HATCHING_DELAY_CYCLES_DOWN, + GADGET_ID_BD_HATCHING_DELAY_CYCLES_TEXT, + GADGET_ID_BD_HATCHING_DELAY_CYCLES_UP, + GADGET_ID_BD_HATCHING_DELAY_SECONDS_DOWN, + GADGET_ID_BD_HATCHING_DELAY_SECONDS_TEXT, + GADGET_ID_BD_HATCHING_DELAY_SECONDS_UP, GADGET_ID_ELEMENT_VALUE1_DOWN, GADGET_ID_ELEMENT_VALUE1_TEXT, GADGET_ID_ELEMENT_VALUE1_UP, @@ -760,6 +766,8 @@ enum ED_COUNTER_ID_LEVEL_RANDOM, ED_COUNTER_ID_BD_CYCLE_DELAY_MS, ED_COUNTER_ID_BD_CYCLE_DELAY_C64, + ED_COUNTER_ID_BD_HATCHING_DELAY_CYCLES, + ED_COUNTER_ID_BD_HATCHING_DELAY_SECONDS, ED_COUNTER_ID_ELEMENT_VALUE1, ED_COUNTER_ID_ELEMENT_VALUE2, ED_COUNTER_ID_ELEMENT_VALUE3, @@ -1515,6 +1523,24 @@ static struct &level.bd_cycle_delay_c64, NULL, NULL, "game cycle delay (C64-style)" }, + { + ED_COUNTER_ID_BD_HATCHING_DELAY_CYCLES, + ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(4), + 1, 40, + GADGET_ID_BD_HATCHING_DELAY_CYCLES_DOWN, GADGET_ID_BD_HATCHING_DELAY_CYCLES_UP, + GADGET_ID_BD_HATCHING_DELAY_CYCLES_TEXT, GADGET_ID_NONE, + &level.bd_hatching_delay_cycles, + NULL, NULL, "hatching delay (cycles)" + }, + { + ED_COUNTER_ID_BD_HATCHING_DELAY_SECONDS, + ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(4), + 1, 40, + GADGET_ID_BD_HATCHING_DELAY_SECONDS_DOWN, GADGET_ID_BD_HATCHING_DELAY_SECONDS_UP, + GADGET_ID_BD_HATCHING_DELAY_SECONDS_TEXT, GADGET_ID_NONE, + &level.bd_hatching_delay_seconds, + NULL, NULL, "hatching delay (seconds)" + }, // ---------- element settings: configure (various elements) ---------------- @@ -10072,9 +10098,15 @@ static void DrawLevelConfigEngine(void) // draw counter gadgets if (level.bd_scheduling_type == GD_SCHEDULING_MILLISECONDS) + { MapCounterButtons(ED_COUNTER_ID_BD_CYCLE_DELAY_MS); + MapCounterButtons(ED_COUNTER_ID_BD_HATCHING_DELAY_CYCLES); + } else + { MapCounterButtons(ED_COUNTER_ID_BD_CYCLE_DELAY_C64); + MapCounterButtons(ED_COUNTER_ID_BD_HATCHING_DELAY_SECONDS); + } // draw checkbutton gadgets for (i = ED_CHECKBUTTON_ID_ENGINE_FIRST; i <= ED_CHECKBUTTON_ID_ENGINE_LAST; i++) diff --git a/src/files.c b/src/files.c index 898b33bb..8044d338 100644 --- a/src/files.c +++ b/src/files.c @@ -303,6 +303,18 @@ static struct LevelFileConfigInfo chunk_config_INFO[] = &li.bd_cycle_delay_c64, 0 }, + { + -1, -1, + TYPE_INTEGER, CONF_VALUE_8_BIT(18), + &li.bd_hatching_delay_cycles, 21 + }, + + { + -1, -1, + TYPE_INTEGER, CONF_VALUE_8_BIT(19), + &li.bd_hatching_delay_seconds, 2 + }, + { -1, -1, -1, -1, @@ -3742,6 +3754,8 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level) cave->level_speed[i] = level->bd_cycle_delay_ms; cave->level_ckdelay[i] = level->bd_cycle_delay_c64; + cave->level_hatching_delay_frame[i] = level->bd_hatching_delay_cycles; + cave->level_hatching_delay_time[i] = level->bd_hatching_delay_seconds; cave->level_timevalue[i] = level->score[SC_TIME_BONUS]; } @@ -3778,6 +3792,8 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level) level->bd_cycle_delay_ms = cave->level_speed[bd_level_nr]; level->bd_cycle_delay_c64 = cave->level_ckdelay[bd_level_nr]; + level->bd_hatching_delay_cycles = cave->level_hatching_delay_frame[bd_level_nr]; + level->bd_hatching_delay_seconds = cave->level_hatching_delay_time[bd_level_nr]; level->score[SC_TIME_BONUS] = cave->level_timevalue[bd_level_nr]; level->score[SC_EMERALD] = cave->diamond_value; diff --git a/src/main.h b/src/main.h index fc1a1cec..be4eb9c3 100644 --- a/src/main.h +++ b/src/main.h @@ -3484,6 +3484,8 @@ struct LevelInfo boolean bd_pal_timing; // BD engine special timing boolean bd_cycle_delay_ms; // BD game cycle delay (in milliseconds) boolean bd_cycle_delay_c64; // BD game cycle delay (in C64 game units) + boolean bd_hatching_delay_cycles; // BD hatching delay (in game cycles) + boolean bd_hatching_delay_seconds; // BD hatching delay (in seconds) boolean bd_intermission; // BD level is intermission boolean bd_diagonal_movements; // BD style diagonal movements boolean em_slippery_gems; // EM style "gems slip from wall" behaviour