added support for line-shifting wrap-around in BD engine to level editor
authorHolger Schemel <info@artsoft.org>
Sun, 10 Mar 2024 16:40:10 +0000 (17:40 +0100)
committerHolger Schemel <info@artsoft.org>
Sun, 10 Mar 2024 16:40:12 +0000 (17:40 +0100)
src/editor.c
src/files.c
src/main.h

index 6d8bd174f876727a3ec06aff7a28b62f9aca3916..f0c1cc234341c9087b4c3bf8f2dd6e24aa043e08 100644 (file)
@@ -664,6 +664,7 @@ enum
   GADGET_ID_RANDOM_RESTRICTED,
   GADGET_ID_BD_INTERMISSION,
   GADGET_ID_BD_PAL_TIMING,
+  GADGET_ID_BD_LINE_SHIFTING_BORDERS,
   GADGET_ID_STICK_ELEMENT,
   GADGET_ID_EM_SLIPPERY_GEMS,
   GADGET_ID_EM_EXPLODES_BY_FIRE,
@@ -991,6 +992,7 @@ enum
   ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE_2,
   ED_CHECKBUTTON_ID_BD_INTERMISSION,
   ED_CHECKBUTTON_ID_BD_PAL_TIMING,
+  ED_CHECKBUTTON_ID_BD_LINE_SHIFTING_BORDERS,
   ED_CHECKBUTTON_ID_STICK_ELEMENT,
   ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS,
   ED_CHECKBUTTON_ID_EM_EXPLODES_BY_FIRE,
@@ -1072,7 +1074,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_PAL_TIMING
+#define ED_CHECKBUTTON_ID_ENGINE_LAST  ED_CHECKBUTTON_ID_BD_LINE_SHIFTING_BORDERS
 
 #define ED_CHECKBUTTON_ID_CUSTOM1_FIRST        ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC
 #define ED_CHECKBUTTON_ID_CUSTOM1_LAST ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE
@@ -3343,6 +3345,14 @@ static struct
     NULL, NULL,
     "PAL timing",                      "use slower timer (like PAL C64)"
   },
+  {
+    ED_CHECKBUTTON_ID_BD_LINE_SHIFTING_BORDERS,
+    ED_LEVEL_SETTINGS_XPOS(0),         ED_LEVEL_SETTINGS_YPOS(5),
+    GADGET_ID_BD_LINE_SHIFTING_BORDERS,        GADGET_ID_NONE,
+    &level.bd_line_shifting_borders,
+    NULL, NULL,
+    "line-shifting borders",           "use line-shifting wrap-around"
+  },
 
   // ---------- element settings: configure (various elements) ----------------
 
index 8044d338699f6320db107d04e9f62daf8306a625..e6e2281694d66a945891aa0c3abcb3a55d2cf850 100644 (file)
@@ -315,6 +315,12 @@ static struct LevelFileConfigInfo chunk_config_INFO[] =
     &li.bd_hatching_delay_seconds,     2
   },
 
+  {
+    -1,                                        -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(20),
+    &li.bd_line_shifting_borders,      FALSE
+  },
+
   {
     -1,                                        -1,
     -1,                                        -1,
@@ -3768,6 +3774,8 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level)
   cave->intermission                   = level->bd_intermission;
   cave->diagonal_movements             = level->bd_diagonal_movements;
 
+  cave->lineshift                      = level->bd_line_shifting_borders;
+
   strncpy(cave->name, level->name, sizeof(GdString));
   cave->name[sizeof(GdString) - 1] = '\0';
 
@@ -3804,6 +3812,8 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level)
   level->bd_intermission               = cave->intermission;
   level->bd_diagonal_movements         = cave->diagonal_movements;
 
+  level->bd_line_shifting_borders      = cave->lineshift;
+
   char *cave_name = getStringPrint("%s / %d", cave->name, bd_level_nr + 1);
 
   strncpy(level->name, cave_name, MAX_LEVEL_NAME_LEN);
index 90bd7ae0c211d23df20ecf7aee4356d21346ae36..fcdcaf2613ec4e2632a06a3d76684347b5420a18 100644 (file)
@@ -3486,6 +3486,7 @@ struct LevelInfo
   int bd_hatching_delay_seconds;       // BD hatching delay (in seconds)
   int bd_scheduling_type;              // BD engine scheduling type
   boolean bd_pal_timing;               // BD engine uses special PAL timing
+  boolean bd_line_shifting_borders;    // BD engine uses line-shifting wrap-around
   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