From: Holger Schemel Date: Thu, 2 Jan 2025 13:19:43 +0000 (+0100) Subject: added variable to be set when using reduced color template colors X-Git-Tag: 4.4.0.1~63 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=65530098f7ca1d856b6d1d1047066311af465aef;p=rocksndiamonds.git added variable to be set when using reduced color template colors --- diff --git a/src/game_bd/bd_graphics.c b/src/game_bd/bd_graphics.c index b23ce613..15f7af82 100644 --- a/src/game_bd/bd_graphics.c +++ b/src/game_bd/bd_graphics.c @@ -377,6 +377,9 @@ static SDL_Surface *get_colored_surface_from_template(GdCave *cave, SDL_Surface g = color[index].g * color_value / 255; b = color[index].b * color_value / 255; + if (index > 5) + gfx.has_reduced_color_template = FALSE; + if (color_value > 0 && color_value < 255) gfx.has_extended_color_template = TRUE; } diff --git a/src/init.c b/src/init.c index 6302b927..9c579a8f 100644 --- a/src/init.c +++ b/src/init.c @@ -387,7 +387,9 @@ void InitColorTemplateImages(void) void InitColorTemplateImagesIfNeeded(void) { + gfx.has_reduced_color_template = TRUE; gfx.has_extended_color_template = FALSE; + game.InitColorTemplateImagesNeeded = FALSE; if (program.headless) diff --git a/src/libgame/system.h b/src/libgame/system.h index b432bdd8..2f6d4313 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -1256,6 +1256,7 @@ struct GfxInfo int cursor_mode_final; int mouse_x, mouse_y; + boolean has_reduced_color_template; boolean has_extended_color_template; };