From: Holger Schemel Date: Sat, 10 Aug 2024 10:58:45 +0000 (+0200) Subject: fixed clipping BD engine intermission levels in editor X-Git-Tag: 4.4.0.0-test-4~315 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=d7ac3e0f7460e081132f1f688cc5c42b518b5141;p=rocksndiamonds.git fixed clipping BD engine intermission levels in editor --- diff --git a/src/editor.c b/src/editor.c index d2d020fa..c7748d57 100644 --- a/src/editor.c +++ b/src/editor.c @@ -790,6 +790,7 @@ enum GADGET_ID_RANDOM_QUANTITY, GADGET_ID_RANDOM_RESTRICTED, GADGET_ID_BD_INTERMISSION, + GADGET_ID_BD_INTERMISSION_CLIPPED, GADGET_ID_BD_PAL_TIMING, GADGET_ID_BD_LINE_SHIFTING_BORDERS, GADGET_ID_BD_SCAN_FIRST_AND_LAST_ROW, @@ -1175,6 +1176,7 @@ enum ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE_3, ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE_2, ED_CHECKBUTTON_ID_BD_INTERMISSION, + ED_CHECKBUTTON_ID_BD_INTERMISSION_CLIPPED, ED_CHECKBUTTON_ID_BD_PAL_TIMING, ED_CHECKBUTTON_ID_BD_LINE_SHIFTING_BORDERS, ED_CHECKBUTTON_ID_BD_SCAN_FIRST_AND_LAST_ROW, @@ -3851,6 +3853,14 @@ static struct "Boulder Dash game engine settings:", NULL, "Intermission", "Level is an intermission level" }, + { + ED_CHECKBUTTON_ID_BD_INTERMISSION_CLIPPED, + -1, ED_ENGINE_SETTINGS_YPOS(0), + GADGET_ID_BD_INTERMISSION_CLIPPED, GADGET_ID_BD_INTERMISSION, + &level.bd_intermission_clipped, + NULL, " ", + "Clipped", "Clip to standard intermission size" + }, { ED_CHECKBUTTON_ID_BD_PAL_TIMING, ED_ENGINE_SETTINGS_XPOS(0), ED_ENGINE_SETTINGS_YPOS(2), diff --git a/src/files.c b/src/files.c index 589c34dc..a0e7df1f 100644 --- a/src/files.c +++ b/src/files.c @@ -311,6 +311,11 @@ static struct LevelFileConfigInfo chunk_config_INFO[] = TYPE_INTEGER, CONF_VALUE_8_BIT(23), &li.bd_cave_random_seed_c64, 0 }, + { + -1, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(24), + &li.bd_intermission_clipped, FALSE + }, { -1, -1, TYPE_INTEGER, CONF_VALUE_32_BIT(3), @@ -4297,6 +4302,15 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level) // level type cave->intermission = level->bd_intermission; + // level clipping + if (level->bd_intermission && level->bd_intermission_clipped) + { + cave->x1 = 0; + cave->y1 = 0; + cave->x2 = MIN(19, cave->w - 1); + cave->y2 = MIN(11, cave->h - 1); + } + // level settings cave->level_time[0] = level->time; cave->level_diamonds[0] = level->gems_needed; @@ -4470,6 +4484,16 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level) // level type level->bd_intermission = cave->intermission; + // level clipping + if (cave->intermission && + cave->w == 40 && + cave->h == 22 && + cave->x1 == 0 && + cave->y1 == 0 && + cave->x2 == 19 && + cave->y2 == 11) + level->bd_intermission_clipped = TRUE; + // level settings level->time = cave->level_time[bd_level_nr]; level->gems_needed = cave->level_diamonds[bd_level_nr]; diff --git a/src/main.h b/src/main.h index 0deb4de8..a49be9ae 100644 --- a/src/main.h +++ b/src/main.h @@ -3695,6 +3695,7 @@ struct LevelInfo boolean bd_scan_first_and_last_row; // BD engine scans top and bottom border rows boolean bd_short_explosions; // BD engine uses four game cycles for explosions boolean bd_intermission; // BD level is intermission + boolean bd_intermission_clipped; // BD intermission should be clipped to standard size boolean bd_diagonal_movements; // BD style diagonal movements boolean bd_topmost_player_active; // BD engine uses first player found on playfield int bd_snap_element; // BD element that is created when player is snapping