From f80d5789450769a0173130f94f3708a0f0706f5d Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Fri, 13 Dec 2024 21:04:27 +0100 Subject: [PATCH] added variable to be set when using extended color template colors --- src/game_bd/bd_graphics.c | 3 +++ src/init.c | 1 + src/libgame/system.h | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/game_bd/bd_graphics.c b/src/game_bd/bd_graphics.c index ceaa12df..c6fd7d03 100644 --- a/src/game_bd/bd_graphics.c +++ b/src/game_bd/bd_graphics.c @@ -376,6 +376,9 @@ static SDL_Surface *get_colored_surface_from_template(GdCave *cave, SDL_Surface r = color[index].r * color_value / 255; g = color[index].g * color_value / 255; b = color[index].b * color_value / 255; + + if (color_value > 0 && color_value < 255) + gfx.has_extended_color_template = TRUE; } pixels[out++] = ((r << format->Rshift >> format->Rloss) | diff --git a/src/init.c b/src/init.c index f68d10a9..6302b927 100644 --- a/src/init.c +++ b/src/init.c @@ -387,6 +387,7 @@ void InitColorTemplateImages(void) void InitColorTemplateImagesIfNeeded(void) { + 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 36c41d6f..4a332d0f 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -1255,6 +1255,8 @@ struct GfxInfo int cursor_mode_override; int cursor_mode_final; int mouse_x, mouse_y; + + boolean has_extended_color_template; }; struct TileCursorInfo -- 2.34.1