From: divverent Date: Fri, 16 Jul 2010 09:07:42 +0000 (+0000) Subject: fix ~TEXF_PICMIP in DDS loading, and fix TEXF_ALPHA generation (there was a bug that... X-Git-Tag: xonotic-v0.1.0preview~337 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b7465fb8eb00f41b85e1fe22ea3af991b8524444;p=xonotic%2Fdarkplaces.git fix ~TEXF_PICMIP in DDS loading, and fix TEXF_ALPHA generation (there was a bug that caused TEXF_ALPHA to never be set, now it is set if the caller requested it AND the texture has alpha) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10334 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=3dc7539384989ff69993911802634a1703f0143e --- diff --git a/gl_textures.c b/gl_textures.c index 8b3939d8..f7245a98 100644 --- a/gl_textures.c +++ b/gl_textures.c @@ -1252,7 +1252,7 @@ rtexture_t *R_LoadTextureDDSFile(rtexturepool_t *rtexturepool, const char *filen dds_height = BuffLittleLong(dds+12); ddspixels = dds + 128; - flags &= ~TEXF_ALPHA; + //flags &= ~TEXF_ALPHA; // disabled, as we DISABLE TEXF_ALPHA in the alpha detection, not enable it! if ((dds_format_flags & 0x40) && BuffLittleLong(dds+88) == 32) { // very sloppy BGRA 32bit identification @@ -1389,7 +1389,11 @@ rtexture_t *R_LoadTextureDDSFile(rtexturepool_t *rtexturepool, const char *filen mipheight >>= 1; } - if (dds_miplevels > 1) + // when not requesting mipmaps, do not load them + if(!(flags & TEXF_MIPMAP)) + dds_miplevels = 0; + + if (dds_miplevels >= 1) flags |= TEXF_MIPMAP; else flags &= ~TEXF_MIPMAP;