From: Holger Schemel Date: Sat, 11 Mar 2023 11:23:41 +0000 (+0100) Subject: fixed bug with scaled down background bitmaps X-Git-Tag: 4.3.5.2~11 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=c0bc8a25893dce73e8a64d2fb6f6f330bdbbdf38;p=rocksndiamonds.git fixed bug with scaled down background bitmaps This change makes sure to always use the original sized bitmaps for backgrounds, instead of the "standard size" bitmap size, which can indeed be scaled down if the same image file was used not only for a background bitmap, but also for a game element, but with a tile size larger than 32x32 (which results in the image being scaled down to also get a 32x32 tile size). When using the same image for background graphics, the unmodified original bitmap size must be used instead of the "normalized" or "standard" (scaled down) bitmap size. --- diff --git a/src/tools.c b/src/tools.c index 50846337..373e01b3 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1153,13 +1153,18 @@ void SetBackgroundImage(int graphic, int redraw_mask) if (graphic == IMG_UNDEFINED) g = &g_undefined; + // always use original size bitmap for backgrounds, if existing + Bitmap *bitmap = (g->bitmaps != NULL && + g->bitmaps[IMG_BITMAP_PTR_ORIGINAL] != NULL ? + g->bitmaps[IMG_BITMAP_PTR_ORIGINAL] : g->bitmap); + // remove every mask before setting mask for window, and // remove window area mask before setting mask for main or door area int remove_mask = (redraw_mask == REDRAW_ALL ? 0xffff : REDRAW_ALL); // (!!! TO BE FIXED: The whole REDRAW_* system really sucks! !!!) SetBackgroundBitmap(NULL, remove_mask, 0, 0, 0, 0); // !!! FIX THIS !!! - SetBackgroundBitmap(g->bitmap, redraw_mask, + SetBackgroundBitmap(bitmap, redraw_mask, g->src_x, g->src_y, g->width, g->height); }