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~230^2~144 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=3dc7539384989ff69993911802634a1703f0143e;ds=sidebyside 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 --- 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;