]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix avgcolor calculation with fake S3TC decoding
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 25 Dec 2010 16:48:06 +0000 (16:48 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 25 Dec 2010 16:48:06 +0000 (16:48 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10680 d7cf8633-e32d-0410-b094-e92efae38249

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)