From: Holger Schemel Date: Fri, 8 Mar 2024 17:48:36 +0000 (+0100) Subject: added support for intermission levels in BD engine to level editor X-Git-Tag: 4.4.0.0-test-1~233 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=4cf512b8d6e027c1f9a1616a39d0c7654aa13223;p=rocksndiamonds.git added support for intermission levels in BD engine to level editor --- diff --git a/src/editor.c b/src/editor.c index eeb4c2f9..eae4514e 100644 --- a/src/editor.c +++ b/src/editor.c @@ -649,6 +649,7 @@ enum GADGET_ID_RANDOM_PERCENTAGE, GADGET_ID_RANDOM_QUANTITY, GADGET_ID_RANDOM_RESTRICTED, + GADGET_ID_BD_INTERMISSION, GADGET_ID_STICK_ELEMENT, GADGET_ID_EM_SLIPPERY_GEMS, GADGET_ID_EM_EXPLODES_BY_FIRE, @@ -966,6 +967,7 @@ enum ED_CHECKBUTTON_ID_RANDOM_RESTRICTED, ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE_3, ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE_2, + ED_CHECKBUTTON_ID_BD_INTERMISSION, ED_CHECKBUTTON_ID_STICK_ELEMENT, ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS, ED_CHECKBUTTON_ID_EM_EXPLODES_BY_FIRE, @@ -1046,6 +1048,9 @@ enum #define ED_CHECKBUTTON_ID_EDITOR_FIRST ED_CHECKBUTTON_ID_RANDOM_RESTRICTED #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_INTERMISSION + #define ED_CHECKBUTTON_ID_CUSTOM1_FIRST ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC #define ED_CHECKBUTTON_ID_CUSTOM1_LAST ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE #define ED_CHECKBUTTON_ID_CUSTOM2_FIRST ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE @@ -3241,6 +3246,14 @@ static struct NULL, NULL, "use template for custom elements", "use template for custom properties" }, + { + ED_CHECKBUTTON_ID_BD_INTERMISSION, + ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(0), + GADGET_ID_BD_INTERMISSION, GADGET_ID_NONE, + &level.bd_intermission, + "Boulder Dash game engine settings:", NULL, + "intermission", "level is an intermission level" + }, // ---------- element settings: configure (various elements) ---------------- @@ -9992,6 +10005,11 @@ static void DrawLevelConfigEditor(void) static void DrawLevelConfigEngine(void) { + int i; + + // draw checkbutton gadgets + for (i = ED_CHECKBUTTON_ID_ENGINE_FIRST; i <= ED_CHECKBUTTON_ID_ENGINE_LAST; i++) + MapCheckbuttonGadget(i); } static void DrawLevelConfigWindow(void) diff --git a/src/files.c b/src/files.c index b48fcf4a..8e04c423 100644 --- a/src/files.c +++ b/src/files.c @@ -273,6 +273,12 @@ static struct LevelFileConfigInfo chunk_config_INFO[] = &li.rate_time_over_score, FALSE }, + { + -1, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(14), + &li.bd_intermission, FALSE + }, + { -1, -1, -1, -1, @@ -3719,6 +3725,7 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level) cave->level_speed[0] = 160; // set cave speed + cave->intermission = level->bd_intermission; cave->diagonal_movements = level->bd_diagonal_movements; strncpy(cave->name, level->name, sizeof(GdString)); @@ -3746,6 +3753,7 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level) level->score[SC_TIME_BONUS] = cave->level_timevalue[bd_level_nr]; level->score[SC_DIAMOND] = cave->diamond_value; + level->bd_intermission = cave->intermission; level->bd_diagonal_movements = cave->diagonal_movements; strncpy(level->name, cave->name, MAX_LEVEL_NAME_LEN); diff --git a/src/main.h b/src/main.h index 9a54263f..fc07b5ea 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_intermission; // BD level is intermission boolean bd_diagonal_movements; // BD style diagonal movements boolean em_slippery_gems; // EM style "gems slip from wall" behaviour boolean em_explodes_by_fire; // EM style chain explosion behaviour