+ return R_SetupTexture(rtexturepool, identifier, width, width, 1, 6, R_ShadowMapTextureFlags(precision, filter), -1, TEXTYPE_SHADOWMAP, GLTEXTURETYPE_CUBEMAP, NULL, NULL);
+}
+
+int R_SaveTextureDDSFile(rtexture_t *rt, const char *filename, qboolean skipuncompressed, qboolean hasalpha)
+{
+ gltexture_t *glt = (gltexture_t *)rt;
+ unsigned char *dds;
+ int oldbindtexnum;
+ int bytesperpixel = 0;
+ int bytesperblock = 0;
+ int dds_flags;
+ int dds_format_flags;
+ int dds_caps1;
+ int dds_caps2;
+ int ret;
+ int mip;
+ int mipmaps;
+ int mipinfo[16][4];
+ int ddssize = 128;
+ GLint internalformat;
+ const char *ddsfourcc;
+ if (!rt)
+ return -1; // NULL pointer
+ if (!strcmp(gl_version, "2.0.5885 WinXP Release"))
+ return -2; // broken driver - crashes on reading internal format
+ if (!qglGetTexLevelParameteriv)
+ return -2;
+ GL_ActiveTexture(0);
+ oldbindtexnum = R_Mesh_TexBound(0, gltexturetypeenums[glt->texturetype]);
+ qglBindTexture(gltexturetypeenums[glt->texturetype], glt->texnum);CHECKGLERROR
+ qglGetTexLevelParameteriv(gltexturetypeenums[glt->texturetype], 0, GL_TEXTURE_INTERNAL_FORMAT, &internalformat);
+ switch(internalformat)
+ {
+ default: ddsfourcc = NULL;bytesperpixel = 4;break;
+ case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
+ case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: ddsfourcc = "DXT1";bytesperblock = 8;break;
+ case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: ddsfourcc = "DXT3";bytesperblock = 16;break;
+ case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: ddsfourcc = "DXT5";bytesperblock = 16;break;
+ }
+ if (!bytesperblock && skipuncompressed)
+ return -3; // skipped
+ memset(mipinfo, 0, sizeof(mipinfo));
+ mipinfo[0][0] = glt->tilewidth;
+ mipinfo[0][1] = glt->tileheight;
+ mipmaps = 1;
+ if (glt->flags & TEXF_MIPMAP)
+ {
+ for (mip = 1;mip < 16;mip++)
+ {
+ mipinfo[mip][0] = mipinfo[mip-1][0] > 1 ? mipinfo[mip-1][0] >> 1 : 1;
+ mipinfo[mip][1] = mipinfo[mip-1][1] > 1 ? mipinfo[mip-1][1] >> 1 : 1;
+ if (mipinfo[mip][0] == 1 && mipinfo[mip][1] == 1)
+ {
+ mip++;
+ break;
+ }
+ }
+ mipmaps = mip;
+ }
+ for (mip = 0;mip < mipmaps;mip++)
+ {
+ mipinfo[mip][2] = bytesperblock ? ((mipinfo[mip][0]+3)/4)*((mipinfo[mip][1]+3)/4)*bytesperblock : mipinfo[mip][0]*mipinfo[mip][1]*bytesperpixel;
+ mipinfo[mip][3] = ddssize;
+ ddssize += mipinfo[mip][2];
+ }
+ dds = (unsigned char *)Mem_Alloc(tempmempool, ddssize);
+ if (!dds)
+ return -4;
+ dds_caps1 = 0x1000; // DDSCAPS_TEXTURE
+ dds_caps2 = 0;
+ if (bytesperblock)
+ {
+ dds_flags = 0x81007; // DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_LINEARSIZE
+ dds_format_flags = 0x4; // DDPF_FOURCC
+ }
+ else
+ {
+ dds_flags = 0x100F; // DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH
+ dds_format_flags = 0x40; // DDPF_RGB
+ }
+ if (mipmaps)
+ {
+ dds_flags |= 0x20000; // DDSD_MIPMAPCOUNT
+ dds_caps1 |= 0x400008; // DDSCAPS_MIPMAP | DDSCAPS_COMPLEX
+ }
+ if(hasalpha)
+ dds_format_flags |= 0x1; // DDPF_ALPHAPIXELS
+ memcpy(dds, "DDS ", 4);
+ StoreLittleLong(dds+4, ddssize);
+ 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+28, mipmaps); // mipmaps
+ StoreLittleLong(dds+76, 32); // format size
+ StoreLittleLong(dds+80, dds_format_flags);
+ StoreLittleLong(dds+108, dds_caps1);
+ StoreLittleLong(dds+112, dds_caps2);
+ if (bytesperblock)
+ {
+ StoreLittleLong(dds+20, mipinfo[0][2]); // linear size
+ memcpy(dds+84, ddsfourcc, 4);
+ for (mip = 0;mip < mipmaps;mip++)
+ {
+ qglGetCompressedTexImageARB(gltexturetypeenums[glt->texturetype], mip, dds + mipinfo[mip][3]);CHECKGLERROR
+ }
+ }
+ else
+ {
+ StoreLittleLong(dds+20, mipinfo[0][0]*bytesperpixel); // pitch
+ StoreLittleLong(dds+88, bytesperpixel*8); // bits per pixel
+ dds[94] = dds[97] = dds[100] = dds[107] = 255; // bgra byte order masks
+ for (mip = 0;mip < mipmaps;mip++)
+ {
+ qglGetTexImage(gltexturetypeenums[glt->texturetype], mip, GL_BGRA, GL_UNSIGNED_BYTE, dds + mipinfo[mip][3]);CHECKGLERROR
+ }
+ }
+ qglBindTexture(gltexturetypeenums[glt->texturetype], oldbindtexnum);CHECKGLERROR
+ ret = FS_WriteFile(filename, dds, ddssize);
+ Mem_Free(dds);
+ return ret ? ddssize : -5;
+}
+
+rtexture_t *R_LoadTextureDDSFile(rtexturepool_t *rtexturepool, const char *filename, int flags, qboolean *hasalphaflag, float *avgcolor, int miplevel) // DDS textures are opaque, so miplevel isn't a pointer but just seen as a hint
+{
+ int i, size, dds_format_flags, dds_miplevels, dds_width, dds_height;
+ //int dds_flags;
+ textype_t textype;
+ int bytesperblock, bytesperpixel;
+ int mipcomplete;
+ gltexture_t *glt;
+ gltexturepool_t *pool = (gltexturepool_t *)rtexturepool;
+ textypeinfo_t *texinfo;
+ int mip, mipwidth, mipheight, mipsize;
+ unsigned int c;
+ GLint oldbindtexnum = 0;
+ const unsigned char *mippixels, *ddspixels;
+ unsigned char *dds;
+ fs_offset_t ddsfilesize;
+ unsigned int ddssize;
+
+ if (cls.state == ca_dedicated)
+ return NULL;
+
+ dds = FS_LoadFile(filename, tempmempool, true, &ddsfilesize);
+ ddssize = ddsfilesize;
+
+ if (!dds)
+ {
+ Log_Printf("ddstexturefailures.log", "%s\n", filename);
+ return NULL; // not found
+ }
+
+ if (ddsfilesize <= 128 || memcmp(dds, "DDS ", 4) || ddssize < (unsigned int)BuffLittleLong(dds+4) || BuffLittleLong(dds+76) != 32)
+ {
+ Mem_Free(dds);
+ Con_Printf("^1%s: not a DDS image\n", filename);
+ return NULL;
+ }
+
+ //dds_flags = BuffLittleLong(dds+8);
+ dds_format_flags = BuffLittleLong(dds+80);
+ dds_miplevels = (BuffLittleLong(dds+108) & 0x400000) ? BuffLittleLong(dds+28) : 1;
+ dds_width = BuffLittleLong(dds+16);
+ dds_height = BuffLittleLong(dds+12);
+ ddspixels = dds + 128;
+
+ if(r_texture_dds_load_alphamode.integer == 0)
+ if(!(dds_format_flags & 0x1)) // DDPF_ALPHAPIXELS
+ 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
+ textype = TEXTYPE_BGRA;
+ bytesperblock = 0;
+ bytesperpixel = 4;
+ size = INTOVERFLOW_MUL(INTOVERFLOW_MUL(dds_width, dds_height), bytesperpixel);
+ if(INTOVERFLOW_ADD(128, size) > INTOVERFLOW_NORMALIZE(ddsfilesize))
+ {
+ Mem_Free(dds);
+ Con_Printf("^1%s: invalid BGRA DDS image\n", filename);
+ return NULL;
+ }
+ if((r_texture_dds_load_alphamode.integer == 1) && (flags & TEXF_ALPHA))
+ {
+ // check alpha
+ for (i = 3;i < size;i += 4)
+ if (ddspixels[i] < 255)
+ break;
+ if (i >= size)
+ flags &= ~TEXF_ALPHA;
+ }
+ }
+ else if (!memcmp(dds+84, "DXT1", 4))
+ {
+ if(!vid.support.ext_texture_compression_s3tc)
+ {
+ Mem_Free(dds);
+ return NULL;
+ }
+ // we need to find out if this is DXT1 (opaque) or DXT1A (transparent)
+ // LordHavoc: it is my belief that this does not infringe on the
+ // patent because it is not decoding pixels...
+ textype = TEXTYPE_DXT1;
+ bytesperblock = 8;
+ bytesperpixel = 0;
+ //size = ((dds_width+3)/4)*((dds_height+3)/4)*bytesperblock;
+ size = INTOVERFLOW_MUL(INTOVERFLOW_MUL(INTOVERFLOW_DIV(INTOVERFLOW_ADD(dds_width, 3), 4), INTOVERFLOW_DIV(INTOVERFLOW_ADD(dds_height, 3), 4)), bytesperblock);
+ if(INTOVERFLOW_ADD(128, size) > INTOVERFLOW_NORMALIZE(ddsfilesize))
+ {
+ Mem_Free(dds);
+ Con_Printf("^1%s: invalid DXT1 DDS image\n", filename);
+ return NULL;
+ }
+ if(r_texture_dds_load_alphamode.integer && (flags & TEXF_ALPHA))
+ {
+ if(r_texture_dds_load_alphamode.integer == 1)
+ {
+ // check alpha
+ for (i = 0;i < size;i += bytesperblock)
+ if (ddspixels[i+0] + ddspixels[i+1] * 256 <= ddspixels[i+2] + ddspixels[i+3] * 256)
+ {
+ // NOTE: this assumes sizeof(unsigned int) == 4
+ unsigned int data = * (unsigned int *) &(ddspixels[i+4]);
+ // check if data, in base 4, contains a digit 3 (DXT1: transparent pixel)
+ if(data & (data<<1) & 0xAAAAAAAA)//rgh
+ break;
+ }
+ if (i < size)
+ textype = TEXTYPE_DXT1A;
+ else
+ flags &= ~TEXF_ALPHA;
+ }
+ else
+ {
+ flags &= ~TEXF_ALPHA;
+ }
+ }
+ }
+ else if (!memcmp(dds+84, "DXT3", 4))
+ {
+ if(!vid.support.ext_texture_compression_s3tc)
+ {
+ Mem_Free(dds);
+ return NULL;
+ }
+ textype = TEXTYPE_DXT3;
+ bytesperblock = 16;
+ bytesperpixel = 0;
+ size = INTOVERFLOW_MUL(INTOVERFLOW_MUL(INTOVERFLOW_DIV(INTOVERFLOW_ADD(dds_width, 3), 4), INTOVERFLOW_DIV(INTOVERFLOW_ADD(dds_height, 3), 4)), bytesperblock);
+ if(INTOVERFLOW_ADD(128, size) > INTOVERFLOW_NORMALIZE(ddsfilesize))
+ {
+ Mem_Free(dds);
+ Con_Printf("^1%s: invalid DXT3 DDS image\n", filename);
+ return NULL;
+ }
+ // we currently always assume alpha
+ }
+ else if (!memcmp(dds+84, "DXT5", 4))
+ {
+ if(!vid.support.ext_texture_compression_s3tc)
+ {
+ Mem_Free(dds);
+ return NULL;
+ }
+ textype = TEXTYPE_DXT5;
+ bytesperblock = 16;
+ bytesperpixel = 0;
+ size = INTOVERFLOW_MUL(INTOVERFLOW_MUL(INTOVERFLOW_DIV(INTOVERFLOW_ADD(dds_width, 3), 4), INTOVERFLOW_DIV(INTOVERFLOW_ADD(dds_height, 3), 4)), bytesperblock);
+ if(INTOVERFLOW_ADD(128, size) > INTOVERFLOW_NORMALIZE(ddsfilesize))
+ {
+ Mem_Free(dds);
+ Con_Printf("^1%s: invalid DXT5 DDS image\n", filename);
+ return NULL;
+ }
+ // we currently always assume alpha
+ }
+ else
+ {
+ Mem_Free(dds);
+ Con_Printf("^1%s: unrecognized/unsupported DDS format\n", filename);
+ return NULL;
+ }
+
+ // return whether this texture is transparent
+ if (hasalphaflag)
+ *hasalphaflag = (flags & TEXF_ALPHA) != 0;
+
+ // calculate average color if requested
+ if (avgcolor)
+ {
+ float f;
+ Vector4Clear(avgcolor);
+ if (bytesperblock)
+ {
+ for (i = bytesperblock == 16 ? 8 : 0;i < size;i += bytesperblock)
+ {
+ c = ddspixels[i] + 256*ddspixels[i+1] + 65536*ddspixels[i+2] + 16777216*ddspixels[i+3];
+ avgcolor[0] += ((c >> 11) & 0x1F) + ((c >> 27) & 0x1F);
+ avgcolor[1] += ((c >> 5) & 0x3F) + ((c >> 21) & 0x3F);
+ avgcolor[2] += ((c ) & 0x1F) + ((c >> 16) & 0x1F);
+ }
+ f = (float)bytesperblock / size;
+ avgcolor[0] *= (0.5f / 31.0f) * f;
+ avgcolor[1] *= (0.5f / 63.0f) * f;
+ avgcolor[2] *= (0.5f / 31.0f) * f;
+ avgcolor[3] = 1; // too hard to calculate
+ }
+ else
+ {
+ for (i = 0;i < size;i += 4)
+ {
+ avgcolor[0] += ddspixels[i+2];
+ avgcolor[1] += ddspixels[i+1];
+ avgcolor[2] += ddspixels[i];
+ avgcolor[3] += ddspixels[i+3];
+ }
+ f = (1.0f / 255.0f) * bytesperpixel / size;
+ avgcolor[0] *= f;
+ avgcolor[1] *= f;
+ avgcolor[2] *= f;
+ avgcolor[3] *= f;
+ }
+ }
+
+ // this is where we apply gl_picmip
+ mippixels = ddspixels;
+ mipwidth = dds_width;
+ mipheight = dds_height;
+ while(miplevel >= 1 && dds_miplevels >= 1)
+ {
+ if (mipwidth <= 1 && mipheight <= 1)
+ break;
+ mipsize = bytesperblock ? ((mipwidth+3)/4)*((mipheight+3)/4)*bytesperblock : mipwidth*mipheight*bytesperpixel;
+ mippixels += mipsize; // just skip
+ --dds_miplevels;
+ --miplevel;
+ if (mipwidth > 1)
+ mipwidth >>= 1;
+ if (mipheight > 1)
+ mipheight >>= 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;
+
+ // if S3TC is not supported, there's very little we can do about it
+ if (bytesperblock && !vid.support.ext_texture_compression_s3tc)
+ {
+ Mem_Free(dds);
+ Con_Printf("^1%s: DDS file is compressed but OpenGL driver does not support S3TC\n", filename);
+ return NULL;
+ }
+
+ texinfo = R_GetTexTypeInfo(textype, flags);
+
+ glt = (gltexture_t *)Mem_ExpandableArray_AllocRecord(&texturearray);
+ strlcpy (glt->identifier, filename, sizeof(glt->identifier));
+ glt->pool = pool;
+ glt->chain = pool->gltchain;
+ pool->gltchain = glt;
+ glt->inputwidth = mipwidth;
+ glt->inputheight = mipheight;
+ glt->inputdepth = 1;
+ glt->flags = flags;
+ glt->textype = texinfo;
+ glt->texturetype = GLTEXTURETYPE_2D;
+ glt->inputdatasize = ddssize;
+ glt->glinternalformat = texinfo->glinternalformat;
+ glt->glformat = texinfo->glformat;
+ glt->gltype = texinfo->gltype;
+ glt->bytesperpixel = texinfo->internalbytesperpixel;
+ glt->sides = 1;
+ glt->gltexturetypeenum = gltexturetypeenums[glt->texturetype];
+ glt->tilewidth = mipwidth;
+ glt->tileheight = mipheight;
+ glt->tiledepth = 1;
+ glt->miplevels = dds_miplevels;
+
+ // texture uploading can take a while, so make sure we're sending keepalives
+ CL_KeepaliveMessage(false);
+
+ // create the texture object
+ switch(vid.renderpath)
+ {
+ case RENDERPATH_GL11:
+ case RENDERPATH_GL13:
+ case RENDERPATH_GL20:
+ case RENDERPATH_CGGL:
+ CHECKGLERROR
+ GL_ActiveTexture(0);
+ oldbindtexnum = R_Mesh_TexBound(0, gltexturetypeenums[glt->texturetype]);
+ qglGenTextures(1, (GLuint *)&glt->texnum);CHECKGLERROR
+ qglBindTexture(gltexturetypeenums[glt->texturetype], glt->texnum);CHECKGLERROR
+ break;
+ case RENDERPATH_D3D9:
+#ifdef SUPPORTD3D
+ {
+ D3DFORMAT d3dformat;
+ D3DPOOL d3dpool;
+ DWORD d3dusage;
+ switch(textype)
+ {
+ 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;
+ default: d3dformat = D3DFMT_A8R8G8B8;Host_Error("R_LoadTextureDDSFile: unsupported texture type %i when picking D3DFMT", (int)textype);break;
+ }
+ d3dusage = 0;
+ d3dpool = D3DPOOL_MANAGED;
+ IDirect3DDevice9_CreateTexture(vid_d3d9dev, glt->tilewidth, glt->tileheight, glt->miplevels, d3dusage, d3dformat, d3dpool, (IDirect3DTexture9 **)&glt->d3dtexture, NULL);
+ }
+#endif
+ break;
+ case RENDERPATH_D3D10:
+ Con_DPrintf("FIXME D3D10 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
+ break;
+ case RENDERPATH_D3D11:
+ Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
+ break;
+ }
+
+ // upload the texture
+ // we need to restore the texture binding after finishing the upload
+ mipcomplete = false;
+
+ for (mip = 0;mip <= dds_miplevels;mip++) // <= to include the not-counted "largest" miplevel
+ {
+ mipsize = bytesperblock ? ((mipwidth+3)/4)*((mipheight+3)/4)*bytesperblock : mipwidth*mipheight*bytesperpixel;
+ if (mippixels + mipsize > dds + ddssize)
+ break;
+ switch(vid.renderpath)
+ {
+ case RENDERPATH_GL11:
+ case RENDERPATH_GL13:
+ case RENDERPATH_GL20:
+ case RENDERPATH_CGGL:
+ if (bytesperblock)
+ {
+ qglCompressedTexImage2DARB(GL_TEXTURE_2D, mip, glt->glinternalformat, mipwidth, mipheight, 0, mipsize, mippixels);CHECKGLERROR
+ }
+ else
+ {
+ qglTexImage2D(GL_TEXTURE_2D, mip, glt->glinternalformat, mipwidth, mipheight, 0, glt->glformat, glt->gltype, mippixels);CHECKGLERROR
+ }
+ break;
+ case RENDERPATH_D3D9:
+#ifdef SUPPORTD3D
+ {
+ D3DLOCKED_RECT d3dlockedrect;
+ if (IDirect3DTexture9_LockRect((IDirect3DTexture9*)glt->d3dtexture, mip, &d3dlockedrect, NULL, 0) == D3D_OK && d3dlockedrect.pBits)
+ {
+ memcpy(d3dlockedrect.pBits, mippixels, mipsize);
+ IDirect3DTexture9_UnlockRect((IDirect3DTexture9*)glt->d3dtexture, mip);
+ }
+ break;
+ }
+#endif
+ break;
+ case RENDERPATH_D3D10:
+ Con_DPrintf("FIXME D3D10 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
+ break;
+ case RENDERPATH_D3D11:
+ Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
+ break;
+ }
+ mippixels += mipsize;
+ if (mipwidth <= 1 && mipheight <= 1)
+ {
+ mipcomplete = true;
+ break;
+ }
+ if (mipwidth > 1)
+ mipwidth >>= 1;
+ if (mipheight > 1)
+ mipheight >>= 1;
+ }
+
+ // after upload we have to set some parameters...
+ switch(vid.renderpath)
+ {
+ case RENDERPATH_GL11:
+ case RENDERPATH_GL13:
+ case RENDERPATH_GL20:
+ case RENDERPATH_CGGL:
+ if (dds_miplevels >= 1 && !mipcomplete)
+ {
+ // need to set GL_TEXTURE_MAX_LEVEL
+ qglTexParameteri(gltexturetypeenums[glt->texturetype], GL_TEXTURE_MAX_LEVEL, dds_miplevels - 1);CHECKGLERROR
+ }
+ GL_SetupTextureParameters(glt->flags, glt->textype->textype, glt->texturetype);
+ qglBindTexture(gltexturetypeenums[glt->texturetype], oldbindtexnum);CHECKGLERROR
+ break;
+ case RENDERPATH_D3D9:
+#ifdef SUPPORTD3D
+ glt->d3daddressw = 0;
+ if (glt->flags & TEXF_CLAMP)
+ {
+ glt->d3daddressu = D3DTADDRESS_CLAMP;
+ glt->d3daddressv = D3DTADDRESS_CLAMP;
+ if (glt->tiledepth > 1)
+ glt->d3daddressw = D3DTADDRESS_CLAMP;
+ }
+ else
+ {
+ glt->d3daddressu = D3DTADDRESS_WRAP;
+ glt->d3daddressv = D3DTADDRESS_WRAP;
+ if (glt->tiledepth > 1)
+ glt->d3daddressw = D3DTADDRESS_WRAP;
+ }
+ glt->d3dmipmaplodbias = 0;
+ glt->d3dmaxmiplevel = 0;
+ glt->d3dmaxmiplevelfilter = 0;
+ if (glt->flags & TEXF_MIPMAP)
+ {
+ glt->d3dminfilter = d3d_filter_mipmin;
+ glt->d3dmagfilter = d3d_filter_mipmag;
+ glt->d3dmipfilter = d3d_filter_mipmix;
+ }
+ else
+ {
+ glt->d3dminfilter = d3d_filter_flatmin;
+ glt->d3dmagfilter = d3d_filter_flatmag;
+ glt->d3dmipfilter = d3d_filter_flatmix;
+ }
+#endif
+ break;
+ case RENDERPATH_D3D10:
+ Con_DPrintf("FIXME D3D10 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
+ break;
+ case RENDERPATH_D3D11:
+ Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
+ break;
+ }
+
+ Mem_Free(dds);
+ return (rtexture_t *)glt;