From e23be99a49eecaa251be2c19fd62e9c71bc3421c Mon Sep 17 00:00:00 2001 From: Denis Pauk Date: Wed, 16 Dec 2020 23:53:29 +0200 Subject: [PATCH] Fix image shrink calls --- src/client/refresh/soft/sw_image.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/client/refresh/soft/sw_image.c b/src/client/refresh/soft/sw_image.c index acd08c0a..5c38a93b 100644 --- a/src/client/refresh/soft/sw_image.c +++ b/src/client/refresh/soft/sw_image.c @@ -109,8 +109,8 @@ R_ImageShrink(const unsigned char* src, unsigned char *dst, int width, int realw int x, y; float xstep, ystep; - xstep = (float)height / realheight; - ystep = (float)width / realwidth; + xstep = (float)width / realwidth; + ystep = (float)height / realheight; for (y=0; ypixels[i-1], image->pixels[i], - image->height / (1 << (i - 1)), image->height / (1 << i), - image->width / (1 << (i - 1)), image->width / (1 << i)); + image->width >> (i - 1), image->width >> i, + image->height >> (i - 1), image->height >> i); } } @@ -153,10 +153,10 @@ R_RestoreImagePointers(image_t *image, int min_mips) { int i; - for (i=min_mips+1; ipixels[i] = image->pixels[i - 1] + ( - image->width * image->height / (1 << ((i - 1) * 2))); + image->pixels[i + 1] = image->pixels[i] + ( + image->width * image->height / (1 << (i * 2))); } }