rtexture_t *R_LoadTexture2D(rtexturepool_t *rtexturepool, const char *identifier, int width, int height, const unsigned char *data, textype_t textype, int flags, const unsigned int *palette)
{
+ if(!strcmp(identifier, "textures/evil8_floor/e8clangfloor"))
+ Con_Printf("%d\n", flags & TEXF_PICMIP);
+
return R_SetupTexture(rtexturepool, identifier, width, height, 1, 1, flags, textype, GLTEXTURETYPE_2D, data, palette);
}
qboolean Mod_LoadTextureFromQ3Shader(texture_t *texture, const char *name, qboolean warnmissing, qboolean fallback, int defaulttexflags)
{
int j;
+ int texflagsmask;
qboolean success = true;
q3shaderinfo_t *shader;
if (!name)
name = "";
strlcpy(texture->name, name, sizeof(texture->name));
shader = name[0] ? Mod_LookupQ3Shader(name) : NULL;
+
+ texflagsmask = ~0;
+ if(!(defaulttexflags & TEXF_PICMIP))
+ texflagsmask &= ~TEXF_PICMIP;
+ if(!(defaulttexflags & TEXF_COMPRESS))
+ texflagsmask &= ~TEXF_COMPRESS;
+
if (shader)
{
if (developer_loading.integer)
Con_Printf("%s: loaded shader for %s\n", loadmodel->name, name);
texture->surfaceparms = shader->surfaceparms;
- texture->textureflags = shader->textureflags;
// allow disabling of picmip or compression by defaulttexflags
- if(!(defaulttexflags & TEXF_PICMIP))
- texture->textureflags &= ~TEXF_PICMIP;
- if(!(defaulttexflags & TEXF_COMPRESS))
- texture->textureflags &= ~TEXF_COMPRESS;
+ texture->textureflags = shader->textureflags & texflagsmask;
if (shader->surfaceparms & Q3SURFACEPARM_SKY)
{
{
texture->skinframes[j] = NULL;
}
- else if (!(texture->skinframes[j] = R_SkinFrame_LoadExternal(primarylayer->texturename[j], primarylayer->texflags, false)))
+ else if (!(texture->skinframes[j] = R_SkinFrame_LoadExternal(primarylayer->texturename[j], primarylayer->texflags & texflagsmask, false)))
{
Con_Printf("^1%s:^7 could not load texture ^3\"%s\"^7 (frame %i) for shader ^2\"%s\"\n", loadmodel->name, primarylayer->texturename[j], j, texture->name);
texture->skinframes[j] = R_SkinFrame_LoadMissing();
{
texture->skinframes[j] = NULL;
}
- else if (!(texture->backgroundskinframes[j] = R_SkinFrame_LoadExternal(backgroundlayer->texturename[j], backgroundlayer->texflags, false)))
+ else if (!(texture->backgroundskinframes[j] = R_SkinFrame_LoadExternal(backgroundlayer->texturename[j], backgroundlayer->texflags & texflagsmask, false)))
{
Con_Printf("^1%s:^7 could not load texture ^3\"%s\"^7 (background frame %i) for shader ^2\"%s\"\n", loadmodel->name, backgroundlayer->texturename[j], j, texture->name);
texture->backgroundskinframes[j] = R_SkinFrame_LoadMissing();