From f1dd811c3716f706ab832dadf8ef52cf4bfd705d Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 2 Nov 2014 01:44:51 +0100 Subject: [PATCH] fixed bug with not updating default bitmap pointer for scaled images --- ChangeLog | 3 +++ src/init.c | 17 +++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5a7a6ee7..cd522a5d 100644 --- 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 diff --git a/src/init.c b/src/init.c index aea5c31b..18a5a2c1 100644 --- a/src/init.c +++ b/src/init.c @@ -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"); -- 2.34.1