]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_textures.c
fix avgcolor calculation with fake S3TC decoding
[xonotic/darkplaces.git] / gl_textures.c
index e64f22321b6a526b66645e9c3543c228ea2cc306..18f6af853b947250b8f89a27947986decb67db85 100644 (file)
@@ -1995,6 +1995,7 @@ rtexture_t *R_LoadTextureDDSFile(rtexturepool_t *rtexturepool, const char *filen
                        mipheight >>= 1;
        }
        mipsize_total = ddssize - 128 - (mippixels_start - ddspixels);
+       mipsize = bytesperblock ? ((mipwidth+3)/4)*((mipheight+3)/4)*bytesperblock : mipwidth*mipheight*bytesperpixel;
 
        // from here on, we do not need the ddspixels and ddssize any more (apart from the statistics entry in glt)