From 3dc7539384989ff69993911802634a1703f0143e Mon Sep 17 00:00:00 2001 From: divverent Date: Fri, 16 Jul 2010 09:07:42 +0000 Subject: [PATCH] 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 --- gl_textures.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gl_textures.c b/gl_textures.c index d5685c32..448a9cd9 100644 --- a/gl_textures.c +++ b/gl_textures.c @@ -1757,7 +1757,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 @@ -1894,7 +1894,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; -- 2.39.2