From bbaaf64630fcd5e5a407b9156d55ac8ba2c446a1 Mon Sep 17 00:00:00 2001 From: havoc Date: Fri, 19 Nov 2010 13:53:04 +0000 Subject: [PATCH] allow loading DXT2 and DXT4 dds files git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10614 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_textures.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gl_textures.c b/gl_textures.c index 192568fa..98fc44d6 100644 --- a/gl_textures.c +++ b/gl_textures.c @@ -1873,7 +1873,7 @@ rtexture_t *R_LoadTextureDDSFile(rtexturepool_t *rtexturepool, const char *filen } } } - else if (!memcmp(dds+84, "DXT3", 4)) + else if (!memcmp(dds+84, "DXT3", 4) || !memcmp(dds+84, "DXT2", 4)) { if(!vid.support.ext_texture_compression_s3tc) { @@ -1892,7 +1892,7 @@ rtexture_t *R_LoadTextureDDSFile(rtexturepool_t *rtexturepool, const char *filen } // we currently always assume alpha } - else if (!memcmp(dds+84, "DXT5", 4)) + else if (!memcmp(dds+84, "DXT5", 4) || !memcmp(dds+84, "DXT4", 4)) { if(!vid.support.ext_texture_compression_s3tc) { @@ -2045,8 +2045,8 @@ rtexture_t *R_LoadTextureDDSFile(rtexturepool_t *rtexturepool, const char *filen { case TEXTYPE_BGRA: d3dformat = (flags & TEXF_ALPHA) ? D3DFMT_A8R8G8B8 : D3DFMT_X8R8G8B8;break; case TEXTYPE_DXT1: case TEXTYPE_DXT1A: d3dformat = D3DFMT_DXT1;break; - case TEXTYPE_DXT3: d3dformat = D3DFMT_DXT3;break; - case TEXTYPE_DXT5: d3dformat = D3DFMT_DXT5;break; + case TEXTYPE_DXT2: case TEXTYPE_DXT3: d3dformat = D3DFMT_DXT3;break; + case TEXTYPE_DXT4: case TEXTYPE_DXT5: d3dformat = D3DFMT_DXT5;break; default: d3dformat = D3DFMT_A8R8G8B8;Host_Error("R_LoadTextureDDSFile: unsupported texture type %i when picking D3DFMT", (int)textype);break; } d3dusage = 0; -- 2.39.2