]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix ~TEXF_PICMIP in DDS loading, and fix TEXF_ALPHA generation (there was a bug that...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 16 Jul 2010 09:07:42 +0000 (09:07 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 16 Jul 2010 09:07:42 +0000 (09:07 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10334 d7cf8633-e32d-0410-b094-e92efae38249

gl_textures.c

index d5685c3285ee3d1f06d8c9e932aa843eba797cf7..448a9cd97bb4c74686d3ae5c9a13acbe60059565 100644 (file)
@@ -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;