X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fgame_bd%2Fbd_graphics.c;h=ffa099864ac8d7cf08a37d04af0e7512f70e18b4;hb=e5f306fbf1399b5e145afbebfabe1309b972ead9;hp=b88f5bdb3ebbfefc15037f8e87d948228adb5349;hpb=82b69c59921e29a1e121709e5cacbaf13f4be2e1;p=rocksndiamonds.git diff --git a/src/game_bd/bd_graphics.c b/src/game_bd/bd_graphics.c index b88f5bdb..ffa09986 100644 --- a/src/game_bd/bd_graphics.c +++ b/src/game_bd/bd_graphics.c @@ -205,7 +205,6 @@ boolean gd_scroll(GdGame *game, boolean exact_scroll, boolean immediate) boolean out_of_window; int player_x, player_y, visible_x, visible_y; boolean changed; - int scroll_divisor; /* max scrolling speed depends on the speed of the cave. */ /* game moves cell_size_game * 1s / cave time pixels in a second. */ @@ -232,13 +231,6 @@ boolean gd_scroll(GdGame *game, boolean exact_scroll, boolean immediate) /* cell_size contains the scaled size, but we need the original. */ changed = FALSE; - /* some sort of scrolling speed. - with larger cells, the divisor must be smaller, so the scrolling faster. */ - scroll_divisor = 256 / cell_size; - - /* fine scrolling is 50hz (normal would be 25hz only) */ - scroll_divisor *= 2; - if (cave_scroll(visible_x, play_area_w, player_x * cell_size + cell_size / 2 - play_area_w / 2, exact_scroll, &scroll_x, &scroll_desired_x, scroll_speed)) changed = TRUE; @@ -307,6 +299,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 +320,14 @@ 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; + + // do not use smooth movement animation for player entering exit (engine stopped) + if (cave->player_state == GD_PL_EXITED) + use_smooth_movements = FALSE; + #if DO_GFX_SANITY_CHECK if (use_native_bd_graphics_engine() && !setup.small_game_graphics && !program.headless) {