From 8ae80626e71bd1c0205096c648f2562543ffce1a Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Mon, 11 Mar 2024 09:30:12 +0100 Subject: [PATCH] added support for scanning first/last row in BD engine to level editor --- src/editor.c | 12 +++++++++++- src/files.c | 8 ++++++++ src/main.h | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/editor.c b/src/editor.c index 73f89c6b..1573c089 100644 --- a/src/editor.c +++ b/src/editor.c @@ -665,6 +665,7 @@ enum GADGET_ID_BD_INTERMISSION, GADGET_ID_BD_PAL_TIMING, GADGET_ID_BD_LINE_SHIFTING_BORDERS, + GADGET_ID_BD_SCAN_FIRST_AND_LAST_ROW, GADGET_ID_STICK_ELEMENT, GADGET_ID_EM_SLIPPERY_GEMS, GADGET_ID_EM_EXPLODES_BY_FIRE, @@ -993,6 +994,7 @@ enum ED_CHECKBUTTON_ID_BD_INTERMISSION, ED_CHECKBUTTON_ID_BD_PAL_TIMING, ED_CHECKBUTTON_ID_BD_LINE_SHIFTING_BORDERS, + ED_CHECKBUTTON_ID_BD_SCAN_FIRST_AND_LAST_ROW, ED_CHECKBUTTON_ID_STICK_ELEMENT, ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS, ED_CHECKBUTTON_ID_EM_EXPLODES_BY_FIRE, @@ -1074,7 +1076,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_LINE_SHIFTING_BORDERS +#define ED_CHECKBUTTON_ID_ENGINE_LAST ED_CHECKBUTTON_ID_BD_SCAN_FIRST_AND_LAST_ROW #define ED_CHECKBUTTON_ID_CUSTOM1_FIRST ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC #define ED_CHECKBUTTON_ID_CUSTOM1_LAST ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE @@ -3353,6 +3355,14 @@ static struct "Compatibility settings:", NULL, "line-shifting borders", "use line-shifting wrap-around" }, + { + ED_CHECKBUTTON_ID_BD_SCAN_FIRST_AND_LAST_ROW, + ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(7), + GADGET_ID_BD_SCAN_FIRST_AND_LAST_ROW, GADGET_ID_NONE, + &level.bd_scan_first_and_last_row, + NULL, NULL, + "scan first and last row", "also process top/bottom border rows" + }, // ---------- element settings: configure (various elements) ---------------- diff --git a/src/files.c b/src/files.c index b5ac78f2..5f1faac6 100644 --- a/src/files.c +++ b/src/files.c @@ -327,6 +327,12 @@ static struct LevelFileConfigInfo chunk_config_INFO[] = &li.bd_wraparound_objects, FALSE }, + { + -1, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(22), + &li.bd_scan_first_and_last_row, TRUE + }, + { -1, -1, -1, -1, @@ -3782,6 +3788,7 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level) cave->lineshift = level->bd_line_shifting_borders; cave->wraparound_objects = level->bd_wraparound_objects; + cave->border_scan_first_and_last = level->bd_scan_first_and_last_row; strncpy(cave->name, level->name, sizeof(GdString)); cave->name[sizeof(GdString) - 1] = '\0'; @@ -3821,6 +3828,7 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level) level->bd_line_shifting_borders = cave->lineshift; level->bd_wraparound_objects = cave->wraparound_objects; + level->bd_scan_first_and_last_row = cave->border_scan_first_and_last; char *cave_name = getStringPrint("%s / %d", cave->name, bd_level_nr + 1); diff --git a/src/main.h b/src/main.h index 65ee52c6..59dfc59e 100644 --- a/src/main.h +++ b/src/main.h @@ -3488,6 +3488,7 @@ struct LevelInfo boolean bd_pal_timing; // BD engine uses special PAL timing boolean bd_line_shifting_borders; // BD engine uses line-shifting wrap-around boolean bd_wraparound_objects; // BD cave object rendering uses wrap-around + boolean bd_scan_first_and_last_row; // BD engine scans top and bottom border rows 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 -- 2.34.1