X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_bd%2Fbd_graphics.c;h=ef87fc0f9465267ed2e79db8d00c5f2c8eb91147;hb=1e7b6eb2aa8ee9f348a444900cfb614d6adaad76;hp=b171b763b7ad261799cc12e4ac756befbde51924;hpb=40a2fe903817ae402dcce11b691391d15a590ff8;p=rocksndiamonds.git diff --git a/src/game_bd/bd_graphics.c b/src/game_bd/bd_graphics.c index b171b763..ef87fc0f 100644 --- a/src/game_bd/bd_graphics.c +++ b/src/game_bd/bd_graphics.c @@ -61,6 +61,8 @@ static int cell_size = 0; // graphic info for game objects/frames and players/actions/frames struct GraphicInfo_BD graphic_info_bd_object[O_MAX_ALL][8]; +// graphic info for game graphics template for level-specific colors +struct GraphicInfo_BD graphic_info_bd_color_template; static inline int c64_png_colors(int r, int g, int b, int a) { @@ -259,6 +261,13 @@ boolean gd_scroll(GdGame *game, boolean exact_scroll, boolean immediate) player_x = game->cave->player_x - game->cave->x1; // cell coordinates of player player_y = game->cave->player_y - game->cave->y1; + // when wrapping around to opposite level border, use faster scrolling + if (game->cave->player_x == game->cave->x1 || + game->cave->player_x == game->cave->x2 || + game->cave->player_y == game->cave->y1 || + game->cave->player_y == game->cave->y2) + scroll_speed *= 4; + // pixel size of visible part of the cave (may be smaller in intermissions) visible_x = (game->cave->x2 - game->cave->x1 + 1) * cell_size; visible_y = (game->cave->y2 - game->cave->y1 + 1) * cell_size; @@ -455,6 +464,9 @@ void gd_prepare_tile_bitmap(GdCave *cave, Bitmap *bitmap, int scale_down_factor) static Bitmap *gd_tile_bitmap_original = NULL; static int scale_down_factor_last = -1; + if (program.headless) + return; + // check if tile bitmap has changed (different artwork or tile size selected) if (bitmap != gd_tile_bitmap_original || scale_down_factor != scale_down_factor_last) { @@ -611,8 +623,8 @@ static void gd_drawcave_tile(Bitmap *dest, GdGame *game, int x, int y, boolean d // redraw previous game element on the cave field the new element is moving to int tile_last = game->last_element_buffer[y][x]; - // only redraw previous game element if it is not collectible (like dirt etc.) - if (is_collectible(tile_last)) + // only redraw previous game element if it is diggable (like dirt etc.) + if (!is_diggable(tile_last)) tile_last = O_SPACE; struct GraphicInfo_BD *g_old = &graphic_info_bd_object[tile_last][frame]; @@ -648,7 +660,9 @@ static void gd_drawcave_tile(Bitmap *dest, GdGame *game, int x, int y, boolean d else { // if old tile also moving (like pushing player), do not redraw tile background - game->last_element_buffer[old_y][old_x] |= SKIPPED; + // (but redraw if tile and old tile are moving/falling into different directions) + if (game->dir_buffer[old_y][old_x] == game->dir_buffer[y][x]) + game->last_element_buffer[old_y][old_x] |= SKIPPED; } }