]> 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)
committerRudolf Polzer <divverent@alientrap.org>
Wed, 21 Jul 2010 04:56:59 +0000 (06:56 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10334 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=3dc7539384989ff69993911802634a1703f0143e

gl_textures.c

index 8b3939d8889294ab787acd1f777f46c3c20410db..f7245a9892cbb859d09a79f8809378f4a5c1e27f 100644 (file)
@@ -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;