fix two errors in DDS format as written by DP
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 16 Jul 2011 18:54:18 +0000 (18:54 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 16 Jul 2011 18:54:18 +0000 (18:54 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11247 d7cf8633-e32d-0410-b094-e92efae38249

gl_textures.c

index edefc5a..f675908 100644 (file)
@@ -1911,11 +1911,11 @@ int R_SaveTextureDDSFile(rtexture_t *rt, const char *filename, qboolean skipunco
        if(hasalpha)
                dds_format_flags |= 0x1; // DDPF_ALPHAPIXELS
        memcpy(dds, "DDS ", 4);
-       StoreLittleLong(dds+4, ddssize);
+       StoreLittleLong(dds+4, 124); // http://msdn.microsoft.com/en-us/library/bb943982%28v=vs.85%29.aspx says so
        StoreLittleLong(dds+8, dds_flags);
        StoreLittleLong(dds+12, mipinfo[0][1]); // height
        StoreLittleLong(dds+16, mipinfo[0][0]); // width
-       StoreLittleLong(dds+24, 1); // depth
+       StoreLittleLong(dds+24, 0); // depth
        StoreLittleLong(dds+28, mipmaps); // mipmaps
        StoreLittleLong(dds+76, 32); // format size
        StoreLittleLong(dds+80, dds_format_flags);