From: Holger Schemel Date: Wed, 6 Mar 2024 22:52:58 +0000 (+0100) Subject: fixed level-specific colors for BD engine using small game elements X-Git-Tag: 4.4.0.0-test-1~243 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=40a2fe903817ae402dcce11b691391d15a590ff8;p=rocksndiamonds.git fixed level-specific colors for BD engine using small game elements --- diff --git a/src/game_bd/bd_graphics.c b/src/game_bd/bd_graphics.c index 32af6e2a..b171b763 100644 --- a/src/game_bd/bd_graphics.c +++ b/src/game_bd/bd_graphics.c @@ -453,15 +453,17 @@ void gd_prepare_tile_bitmap(GdCave *cave, Bitmap *bitmap, int scale_down_factor) { static SDL_Surface *tile_surface_c64 = NULL; static Bitmap *gd_tile_bitmap_original = NULL; + static int scale_down_factor_last = -1; // check if tile bitmap has changed (different artwork or tile size selected) - if (bitmap != gd_tile_bitmap_original) + if (bitmap != gd_tile_bitmap_original || scale_down_factor != scale_down_factor_last) { // check if tile bitmap has limited C64 style colors tile_surface_c64 = get_tile_surface_c64(bitmap->surface, scale_down_factor); - // store original tile bitmap from current artwork set + // store original tile bitmap from current artwork set and scaling factor gd_tile_bitmap_original = bitmap; + scale_down_factor_last = scale_down_factor; // store reference tile bitmap from current artwork set (may be changed later) gd_tile_bitmap_reference = bitmap;