fixed bug with not updating default bitmap pointer for scaled images
authorHolger Schemel <info@artsoft.org>
Sun, 2 Nov 2014 00:44:51 +0000 (01:44 +0100)
committerHolger Schemel <info@artsoft.org>
Sun, 2 Nov 2014 00:44:51 +0000 (01:44 +0100)
ChangeLog
src/init.c

index 5a7a6ee7f1aaf961e7c36a9649461fb4398e9079..cd522a5d7a1a635f7c81273c371d1eb33ad203bc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2014-11-02
+       * fixed bug with not updating default bitmap pointer for scaled images
+
 2014-10-27
        * fixed some smaller issues with loading custom artwork
 
index aea5c31bd576c806c7519a320cd8f7525ab10075..18a5a2c16199f38dfe9521f9419fe330fb5ccddc 100644 (file)
@@ -157,10 +157,6 @@ inline void InitElementSmallImagesScaledUp(int graphic)
 
   // create small and game tile sized bitmaps (and scale up, if needed)
   CreateImageWithSmallImages(graphic, g->scale_up_factor, g->tile_size);
-
-  // default (standard sized) bitmap may have changed now -- update it
-  if (g->bitmaps)
-    g->bitmap = g->bitmaps[IMG_BITMAP_STANDARD];
 }
 
 void InitElementSmallImages()
@@ -214,6 +210,17 @@ void InitScaledImages()
     ScaleImage(i, graphic_info[i].scale_up_factor);
 }
 
+void InitBitmapPointers()
+{
+  int num_images = getImageListSize();
+  int i;
+
+  // standard size bitmap may have changed -- update default bitmap pointer
+  for (i = 0; i < num_images; i++)
+    if (graphic_info[i].bitmaps)
+      graphic_info[i].bitmap = graphic_info[i].bitmaps[IMG_BITMAP_STANDARD];
+}
+
 #if 1
 /* !!! FIX THIS (CHANGE TO USING NORMAL ELEMENT GRAPHIC DEFINITIONS) !!! */
 void SetBitmaps_EM(Bitmap **em_bitmap)
@@ -1918,6 +1925,8 @@ static void ReinitializeGraphics()
   print_timestamp_time("InitElementSmallImages");
   InitScaledImages();                  /* scale all other images, if needed */
   print_timestamp_time("InitScaledImages");
+  InitBitmapPointers();                        /* set standard size bitmap pointers */
+  print_timestamp_time("InitBitmapPointers");
   InitFontGraphicInfo();               /* initialize text drawing functions */
   print_timestamp_time("InitFontGraphicInfo");