added preparations for changed color template support (not used yet)
authorHolger Schemel <holger.schemel@virtion.de>
Thu, 3 Oct 2024 08:56:15 +0000 (10:56 +0200)
committerHolger Schemel <holger.schemel@virtion.de>
Thu, 3 Oct 2024 08:56:17 +0000 (10:56 +0200)
src/libgame/image.c

index 4cc613e70062f8031c7703b7fbde5218b664f3dd..30859c3b94bf01cafbc1445d8add39c28cfafbcf 100644 (file)
@@ -24,6 +24,7 @@ struct ImageInfo
   int original_width;                  // original image file width
   int original_height;                 // original image file height
 
+  boolean contains_color_images;       // set after coloring images from template
   boolean contains_small_images;       // set after adding small images
   boolean contains_textures;           // set after adding GPU textures
   boolean scaled_up;                   // set after scaling up
@@ -32,6 +33,8 @@ struct ImageInfo
   int game_tile_size;                  // tile size as resized for game
 
   char *leveldir;                      // level set when image was loaded
+
+  Bitmap *template;                    // optional BD style template bitmap
 };
 typedef struct ImageInfo ImageInfo;
 
@@ -55,6 +58,7 @@ static void *Load_Image(char *filename)
   img_info->original_width  = img_info->bitmaps[IMG_BITMAP_STANDARD]->width;
   img_info->original_height = img_info->bitmaps[IMG_BITMAP_STANDARD]->height;
 
+  img_info->contains_color_images = FALSE;
   img_info->contains_small_images = FALSE;
   img_info->contains_textures = FALSE;
   img_info->scaled_up = FALSE;
@@ -64,6 +68,8 @@ static void *Load_Image(char *filename)
 
   img_info->leveldir = NULL;           // will be set later
 
+  img_info->template = NULL;           // may be set later
+
   return img_info;
 }
 
@@ -79,6 +85,9 @@ static void FreeImage(void *ptr)
     if (image->bitmaps[i])
       FreeBitmap(image->bitmaps[i]);
 
+  if (image->template)
+    FreeBitmap(image->template);
+
   if (image->source_filename)
     free(image->source_filename);