From 61d444dcf583b50771edb971d18126cfc243b352 Mon Sep 17 00:00:00 2001 From: divverent Date: Sat, 25 Dec 2010 16:48:06 +0000 Subject: [PATCH] fix avgcolor calculation with fake S3TC decoding git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10680 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_textures.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gl_textures.c b/gl_textures.c index e64f2232..18f6af85 100644 --- a/gl_textures.c +++ b/gl_textures.c @@ -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) -- 2.39.2