added variable to be set when using extended color template colors
authorHolger Schemel <holger.schemel@virtion.de>
Fri, 13 Dec 2024 20:04:27 +0000 (21:04 +0100)
committerHolger Schemel <holger.schemel@virtion.de>
Fri, 13 Dec 2024 16:05:43 +0000 (17:05 +0100)
src/game_bd/bd_graphics.c
src/init.c
src/libgame/system.h

index ceaa12df5e8210e0b0dc6ba2cbc9ae6f6e8f5062..c6fd7d0310ee0bf78ba61ac57586f5985c4dcee0 100644 (file)
@@ -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) |
index f68d10a9adba7e7aeb1416321c980f157c0b3ff5..6302b927562cabf7bc7e08893dc566f742a6ea30 100644 (file)
@@ -387,6 +387,7 @@ void InitColorTemplateImages(void)
 
 void InitColorTemplateImagesIfNeeded(void)
 {
+  gfx.has_extended_color_template = FALSE;
   game.InitColorTemplateImagesNeeded = FALSE;
 
   if (program.headless)
index 36c41d6f597bc8ed1ba6f94820a7b4b681942fcc..4a332d0ff64ee6b475fc0e9e6da970bbf192070a 100644 (file)
@@ -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