added setup option for using "player is pushing" graphics in BD engine
authorHolger Schemel <info@artsoft.org>
Sun, 14 Apr 2024 19:10:29 +0000 (21:10 +0200)
committerHolger Schemel <info@artsoft.org>
Sun, 14 Apr 2024 19:12:21 +0000 (21:12 +0200)
src/files.c
src/game_bd/bd_cave.c
src/game_bd/export_bd.h
src/game_bd/main_bd.c
src/libgame/system.h
src/screens.c

index ec25f0b25ba0852ebf92261e9e4cbc889105193f..e4c4d0e6052e42826b18671dee2b8e9d8219e160 100644 (file)
@@ -10775,6 +10775,10 @@ static struct TokenInfo global_setup_tokens[] =
     TYPE_SWITCH3,
     &setup.bd_smooth_movements,                        "bd_smooth_movements"
   },
+  {
+    TYPE_SWITCH3,
+    &setup.bd_pushing_graphics,                        "bd_pushing_graphics"
+  },
   {
     TYPE_INTEGER,
     &setup.bd_palette_c64,                     "bd_palette_c64"
@@ -11620,6 +11624,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si)
   si->bd_skip_hatching = FALSE;
   si->bd_scroll_delay = TRUE;
   si->bd_smooth_movements = AUTO;
+  si->bd_pushing_graphics = TRUE;
   si->bd_palette_c64 = GD_DEFAULT_PALETTE_C64;
   si->bd_palette_c64dtv = GD_DEFAULT_PALETTE_C64DTV;
   si->bd_palette_atari = GD_DEFAULT_PALETTE_ATARI;
index 8cc703a493a7022241d47e4e63467cd7e95fc06d..7e808a25727c8239a50a6c5ab0097e283ffc0c9b 100644 (file)
@@ -1541,7 +1541,8 @@ void gd_drawcave_game(const GdCave *cave,
        draw = elemdrawing[actual];
 
       // draw special graphics if player is pushing something
-      if ((cave->last_direction == GD_MV_LEFT || cave->last_direction == GD_MV_RIGHT) &&
+      if (use_bd_pushing_graphics() &&
+         (cave->last_direction == GD_MV_LEFT || cave->last_direction == GD_MV_RIGHT) &&
          is_player(cave, x, y) && can_be_pushed_dir(cave, x, y, cave->last_direction))
       {
        // special check needed when smooth game element movements selected in setup menu:
index b7d624676f66712213de80fe14fd9df0cdc0a6cd..690481a26b801121cd80a5a89215886d850781c1 100644 (file)
@@ -114,6 +114,7 @@ void GameActions_BD(byte[MAX_PLAYERS]);
 
 boolean use_native_bd_graphics_engine(void);
 boolean use_bd_smooth_movements(void);
+boolean use_bd_pushing_graphics(void);
 
 Bitmap **GetTitleScreenBitmaps_BD(void);
 void CoverScreen_BD(void);
index c734d5ea0990875a1b87402c673c073eb374acc4..3992593359260faac31cd6b3823666dd57ac1889 100644 (file)
@@ -446,6 +446,13 @@ boolean use_bd_smooth_movements(void)
          (setup.bd_smooth_movements == AUTO && !use_native_bd_graphics_engine()));
 }
 
+// check if player pushing graphics selected in setup menu
+boolean use_bd_pushing_graphics(void)
+{
+  return ((setup.bd_pushing_graphics == TRUE) ||
+         (setup.bd_pushing_graphics == AUTO && !use_native_bd_graphics_engine()));
+}
+
 Bitmap **GetTitleScreenBitmaps_BD(void)
 {
   Bitmap **title_screen_bitmaps = gd_get_title_screen_bitmaps();
index 78392d89f535e992a941071151c04ff23263b132..8122dfffb28066a65bd1d6e070e48c54b475fd6d 100644 (file)
@@ -1516,6 +1516,7 @@ struct SetupInfo
   boolean bd_skip_hatching;
   boolean bd_scroll_delay;
   int bd_smooth_movements;             // not boolean -- can also be "AUTO"
+  int bd_pushing_graphics;             // not boolean -- can also be "AUTO"
   int bd_palette_c64;
   int bd_palette_c64dtv;
   int bd_palette_atari;
index 2a44ae7b60a3f376fcc1919b1439f44fa0458244..b9f531582208520d1563cbe8d133c814dac0fc0b 100644 (file)
@@ -7973,6 +7973,7 @@ static struct TokenInfo setup_info_engines[] =
   { TYPE_SWITCH,       &setup.bd_skip_hatching,        "Skip hatching player:"         },
   { TYPE_SWITCH,       &setup.bd_scroll_delay,         "Scroll Delay:"                 },
   { TYPE_YES_NO_AUTO,  &setup.bd_smooth_movements,     "Smooth Element Movement:"      },
+  { TYPE_YES_NO_AUTO,  &setup.bd_pushing_graphics,     "Use Player Pushing Graphics:"  },
   { TYPE_ENTER_LIST,   &execSetupChoosePaletteC64,     "Color Palette (C64):"          },
   { TYPE_STRING,       &bd_palette_c64_text,           ""                              },
   { TYPE_ENTER_LIST,   &execSetupChoosePaletteC64DTV,  "Color Palette (C64DTV):"       },