From: Holger Schemel Date: Tue, 20 Feb 2024 22:25:01 +0000 (+0100) Subject: disabled smooth movement for exploding elements (like player) for BD engine X-Git-Tag: 4.4.0.0-test-1~328 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=aa4eb01dedc49a4b9a7f1a03e654b6754069d9cc;p=rocksndiamonds.git disabled smooth movement for exploding elements (like player) for BD engine --- diff --git a/src/game_bd/bd_cave.h b/src/game_bd/bd_cave.h index 35b2b80b..d5cd4b5b 100644 --- a/src/game_bd/bd_cave.h +++ b/src/game_bd/bd_cave.h @@ -167,6 +167,7 @@ enum _element_property E_P_BLOWS_UP_FLIES, /* flies blow up, if they touch this */ E_P_EXPLODES_BY_HIT, /* explodes if hit by a stone */ + E_P_EXPLOSION, /* set for every stage of every explosion. */ E_P_EXPLOSION_FIRST_STAGE, /* set for first stage of every explosion. helps slower/faster explosions changing */ @@ -202,6 +203,7 @@ enum _element_property #define P_BLOWS_UP_FLIES (1 << E_P_BLOWS_UP_FLIES) #define P_EXPLODES_BY_HIT (1 << E_P_EXPLODES_BY_HIT) +#define P_EXPLOSION (1 << E_P_EXPLOSION) #define P_EXPLOSION_FIRST_STAGE (1 << E_P_EXPLOSION_FIRST_STAGE) #define P_NON_EXPLODABLE (1 << E_P_NON_EXPLODABLE) diff --git a/src/game_bd/bd_cavedb.c b/src/game_bd/bd_cavedb.c index 781deab5..fb2f08ef 100644 --- a/src/game_bd/bd_cavedb.c +++ b/src/game_bd/bd_cavedb.c @@ -314,11 +314,11 @@ GdElements gd_elements[] = { O_PRE_DIA_3, N_("Diamond birth (3)"), 0, "DIAMONDBIRTH3", 0, 58, 58, 58, 280 }, /* has ckdelay */ { O_PRE_DIA_4, N_("Diamond birth (4)"), 0, "DIAMONDBIRTH4", 0, 59, 59, 59, 280 }, /* has ckdelay */ { O_PRE_DIA_5, N_("Diamond birth (5)"), 0, "DIAMONDBIRTH5", 0, 60, 60, 60, 280 }, /* has ckdelay */ - { O_EXPLODE_1, N_("Explosion (1)"), P_EXPLOSION_FIRST_STAGE, "EXPLOSION1", 0, 43, 43, 43, 280 }, /* has ckdelay */ - { O_EXPLODE_2, N_("Explosion (2)"), 0, "EXPLOSION2", 0, 44, 44, 44, 280 }, /* has ckdelay */ - { O_EXPLODE_3, N_("Explosion (3)"), 0, "EXPLOSION3", 0, 45, 45, 45, 280 }, /* has ckdelay */ - { O_EXPLODE_4, N_("Explosion (4)"), 0, "EXPLOSION4", 0, 46, 46, 46, 280 }, /* has ckdelay */ - { O_EXPLODE_5, N_("Explosion (5)"), 0, "EXPLOSION5", 0, 47, 47, 47, 280 }, /* has ckdelay */ + { O_EXPLODE_1, N_("Explosion (1)"), P_EXPLOSION | P_EXPLOSION_FIRST_STAGE, "EXPLOSION1", 0, 43, 43, 43, 280 }, /* has ckdelay */ + { O_EXPLODE_2, N_("Explosion (2)"), P_EXPLOSION, "EXPLOSION2", 0, 44, 44, 44, 280 }, /* has ckdelay */ + { O_EXPLODE_3, N_("Explosion (3)"), P_EXPLOSION, "EXPLOSION3", 0, 45, 45, 45, 280 }, /* has ckdelay */ + { O_EXPLODE_4, N_("Explosion (4)"), P_EXPLOSION, "EXPLOSION4", 0, 46, 46, 46, 280 }, /* has ckdelay */ + { O_EXPLODE_5, N_("Explosion (5)"), P_EXPLOSION, "EXPLOSION5", 0, 47, 47, 47, 280 }, /* has ckdelay */ { O_PRE_STONE_1, N_("Stone birth (1)"), P_EXPLOSION_FIRST_STAGE, "BOULDERBIRTH1", 0, 36, 36, 36, 280 }, /* has ckdelay */ { O_PRE_STONE_2, N_("Stone birth (2)"), 0, "BOULDERBIRTH2", 0, 37, 37, 37, 280 }, /* has ckdelay */ { O_PRE_STONE_3, N_("Stone birth (3)"), 0, "BOULDERBIRTH3", 0, 38, 38, 38, 280 }, /* has ckdelay */ @@ -327,26 +327,26 @@ GdElements gd_elements[] = { O_PRE_STEEL_2, N_("Steel birth (2)"), 0, "STEELWALLBIRTH2", 0, 25, 25, 25, 280 }, /* has ckdelay */ { O_PRE_STEEL_3, N_("Steel birth (3)"), 0, "STEELWALLBIRTH3", 0, 26, 26, 26, 280 }, /* has ckdelay */ { O_PRE_STEEL_4, N_("Steel birth (4)"), 0, "STEELWALLBIRTH4", 0, 27, 27, 27, 280 }, /* has ckdelay */ - { O_GHOST_EXPL_1, N_("Ghost explosion (1)"), P_EXPLOSION_FIRST_STAGE, "GHOSTEXPLOSION1", 0, 80, 80, 80, 280 }, /* has ckdelay */ - { O_GHOST_EXPL_2, N_("Ghost explosion (2)"), 0, "GHOSTEXPLOSION2", 0, 81, 81, 81, 280 }, /* has ckdelay */ - { O_GHOST_EXPL_3, N_("Ghost explosion (3)"), 0, "GHOSTEXPLOSION3", 0, 82, 82, 82, 280 }, /* has ckdelay */ - { O_GHOST_EXPL_4, N_("Ghost explosion (4)"), 0, "GHOSTEXPLOSION4", 0, 83, 83, 83, 280 }, /* has ckdelay */ - { O_BOMB_EXPL_1, N_("Bomb explosion (1)"), P_EXPLOSION_FIRST_STAGE, "BOMBEXPLOSION1", 0, 84, 84, 84, 280 }, /* has ckdelay */ - { O_BOMB_EXPL_2, N_("Bomb explosion (2)"), 0, "BOMBEXPLOSION2", 0, 85, 85, 85, 280 }, /* has ckdelay */ - { O_BOMB_EXPL_3, N_("Bomb explosion (3)"), 0, "BOMBEXPLOSION3", 0, 86, 86, 86, 280 }, /* has ckdelay */ - { O_BOMB_EXPL_4, N_("Bomb explosion (4)"), 0, "BOMBEXPLOSION4", 0, 87, 87, 87, 280 }, /* has ckdelay */ - { O_NITRO_EXPL_1, N_("Nitro pack explosion (1)"), P_EXPLOSION_FIRST_STAGE, "NITROEXPLOSION1", 0, 44, 44, 44, 280 }, /* has ckdelay */ - { O_NITRO_EXPL_2, N_("Nitro pack explosion (2)"), 0, "NITROEXPLOSION2", 0, 45, 45, 45, 280 }, /* has ckdelay */ - { O_NITRO_EXPL_3, N_("Nitro pack explosion (3)"), 0, "NITROEXPLOSION3", 0, 46, 46, 46, 280 }, /* has ckdelay */ - { O_NITRO_EXPL_4, N_("Nitro pack explosion (4)"), 0, "NITROEXPLOSION4", 0, 47, 47, 47, 280 }, /* has ckdelay */ - { O_AMOEBA_2_EXPL_1, N_("Amoeba 2 explosion (1)"), P_EXPLOSION_FIRST_STAGE, "AMOEBA2EXPLOSION1", 0, 292, 292, 292, 280 }, /* has ckdelay */ - { O_AMOEBA_2_EXPL_2, N_("Amoeba 2 explosion (2)"), 0, "AMOEBA2EXPLOSION2", 0, 293, 293, 293, 280 }, /* has ckdelay */ - { O_AMOEBA_2_EXPL_3, N_("Amoeba 2 explosion (3)"), 0, "AMOEBA2EXPLOSION3", 0, 294, 294, 294, 280 }, /* has ckdelay */ - { O_AMOEBA_2_EXPL_4, N_("Amoeba 2 explosion (4)"), 0, "AMOEBA2EXPLOSION4", 0, 295, 295, 295, 280 }, /* has ckdelay */ - { O_NUT_EXPL_1, N_("Nut explosion (1)"), P_SLOPED | P_EXPLOSION_FIRST_STAGE, "NUTEXPLOSION1", 0, 360, 360, 360, 280 }, /* has ckdelay */ - { O_NUT_EXPL_2, N_("Nut explosion (2)"), P_SLOPED, "NUTEXPLOSION2", 0, 361, 361, 361, 280 }, /* has ckdelay */ /* these are rounded!! */ - { O_NUT_EXPL_3, N_("Nut explosion (3)"), P_SLOPED, "NUTEXPLOSION3", 0, 362, 362, 362, 280 }, /* has ckdelay */ - { O_NUT_EXPL_4, N_("Nut explosion (4)"), P_SLOPED, "NUTEXPLOSION4", 0, 363, 363, 363, 280 }, /* has ckdelay */ + { O_GHOST_EXPL_1, N_("Ghost explosion (1)"), P_EXPLOSION | P_EXPLOSION_FIRST_STAGE, "GHOSTEXPLOSION1", 0, 80, 80, 80, 280 }, /* has ckdelay */ + { O_GHOST_EXPL_2, N_("Ghost explosion (2)"), P_EXPLOSION, "GHOSTEXPLOSION2", 0, 81, 81, 81, 280 }, /* has ckdelay */ + { O_GHOST_EXPL_3, N_("Ghost explosion (3)"), P_EXPLOSION, "GHOSTEXPLOSION3", 0, 82, 82, 82, 280 }, /* has ckdelay */ + { O_GHOST_EXPL_4, N_("Ghost explosion (4)"), P_EXPLOSION, "GHOSTEXPLOSION4", 0, 83, 83, 83, 280 }, /* has ckdelay */ + { O_BOMB_EXPL_1, N_("Bomb explosion (1)"), P_EXPLOSION | P_EXPLOSION_FIRST_STAGE, "BOMBEXPLOSION1", 0, 84, 84, 84, 280 }, /* has ckdelay */ + { O_BOMB_EXPL_2, N_("Bomb explosion (2)"), P_EXPLOSION, "BOMBEXPLOSION2", 0, 85, 85, 85, 280 }, /* has ckdelay */ + { O_BOMB_EXPL_3, N_("Bomb explosion (3)"), P_EXPLOSION, "BOMBEXPLOSION3", 0, 86, 86, 86, 280 }, /* has ckdelay */ + { O_BOMB_EXPL_4, N_("Bomb explosion (4)"), P_EXPLOSION, "BOMBEXPLOSION4", 0, 87, 87, 87, 280 }, /* has ckdelay */ + { O_NITRO_EXPL_1, N_("Nitro pack explosion (1)"), P_EXPLOSION | P_EXPLOSION_FIRST_STAGE, "NITROEXPLOSION1", 0, 44, 44, 44, 280 }, /* has ckdelay */ + { O_NITRO_EXPL_2, N_("Nitro pack explosion (2)"), P_EXPLOSION, "NITROEXPLOSION2", 0, 45, 45, 45, 280 }, /* has ckdelay */ + { O_NITRO_EXPL_3, N_("Nitro pack explosion (3)"), P_EXPLOSION, "NITROEXPLOSION3", 0, 46, 46, 46, 280 }, /* has ckdelay */ + { O_NITRO_EXPL_4, N_("Nitro pack explosion (4)"), P_EXPLOSION, "NITROEXPLOSION4", 0, 47, 47, 47, 280 }, /* has ckdelay */ + { O_AMOEBA_2_EXPL_1, N_("Amoeba 2 explosion (1)"), P_EXPLOSION | P_EXPLOSION_FIRST_STAGE, "AMOEBA2EXPLOSION1", 0, 292, 292, 292, 280 }, /* has ckdelay */ + { O_AMOEBA_2_EXPL_2, N_("Amoeba 2 explosion (2)"), P_EXPLOSION, "AMOEBA2EXPLOSION2", 0, 293, 293, 293, 280 }, /* has ckdelay */ + { O_AMOEBA_2_EXPL_3, N_("Amoeba 2 explosion (3)"), P_EXPLOSION, "AMOEBA2EXPLOSION3", 0, 294, 294, 294, 280 }, /* has ckdelay */ + { O_AMOEBA_2_EXPL_4, N_("Amoeba 2 explosion (4)"), P_EXPLOSION, "AMOEBA2EXPLOSION4", 0, 295, 295, 295, 280 }, /* has ckdelay */ + { O_NUT_EXPL_1, N_("Nut explosion (1)"), P_SLOPED | P_EXPLOSION | P_EXPLOSION_FIRST_STAGE, "NUTEXPLOSION1", 0, 360, 360, 360, 280 }, /* has ckdelay */ + { O_NUT_EXPL_2, N_("Nut explosion (2)"), P_SLOPED | P_EXPLOSION, "NUTEXPLOSION2", 0, 361, 361, 361, 280 }, /* has ckdelay */ /* these are rounded!! */ + { O_NUT_EXPL_3, N_("Nut explosion (3)"), P_SLOPED | P_EXPLOSION, "NUTEXPLOSION3", 0, 362, 362, 362, 280 }, /* has ckdelay */ + { O_NUT_EXPL_4, N_("Nut explosion (4)"), P_SLOPED | P_EXPLOSION, "NUTEXPLOSION4", 0, 363, 363, 363, 280 }, /* has ckdelay */ { O_PLAYER_PNEUMATIC_LEFT, NULL /* Player using hammer, left */, P_BLOWS_UP_FLIES | P_EXPLODES_BY_HIT | P_PLAYER, "GUYHAMMERl", 0, 265, 265, 265 }, { O_PLAYER_PNEUMATIC_RIGHT, NULL /* Player using hammer, right */, P_BLOWS_UP_FLIES | P_EXPLODES_BY_HIT | P_PLAYER, "GUYHAMMERr", 0, 268, 268, 268 }, diff --git a/src/game_bd/bd_graphics.c b/src/game_bd/bd_graphics.c index b88f5bdb..3d781919 100644 --- a/src/game_bd/bd_graphics.c +++ b/src/game_bd/bd_graphics.c @@ -307,6 +307,12 @@ static inline boolean is_collectible(const int element) return (gd_elements[element & O_MASK].properties & P_COLLECTIBLE) != 0; } +/* returns true if the element is exploding */ +static inline boolean is_explosion(const int element) +{ + return (gd_elements[element & O_MASK].properties & P_EXPLOSION) != 0; +} + static void gd_drawcave_tile(Bitmap *dest, GdGame *game, int x, int y, boolean draw_masked) { void (*blit_bitmap)(Bitmap *, Bitmap *, int, int, int, int, int, int) = @@ -322,6 +328,10 @@ static void gd_drawcave_tile(Bitmap *dest, GdGame *game, int x, int y, boolean d ((setup.bd_smooth_movements == TRUE) || (setup.bd_smooth_movements == AUTO && !use_native_bd_graphics_engine())); + // do not use smooth movement animation for exploding game elements (like player) + if (is_explosion(tile) && dir != GD_MV_STILL) + use_smooth_movements = FALSE; + #if DO_GFX_SANITY_CHECK if (use_native_bd_graphics_engine() && !setup.small_game_graphics && !program.headless) {