Load from wad files only when there isn't already a fallback. This reduces confusion over textures with the same name.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5909 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2021-06-21 15:03:04 +00:00
parent f810be4830
commit 0c41ac0b7d
1 changed files with 12 additions and 9 deletions

View File

@ -14124,16 +14124,19 @@ static void Image_LoadHiResTextureWorker(void *ctx, void *data, size_t a, size_t
}
}
//now look in wad files and swap over the fallback. (halflife compatability)
COM_StripExtension(tex->ident, fname, sizeof(fname));
buf = W_GetTexture(fname, &imgwidth, &imgheight, &format);
if (buf)
if (!tex->fallbackdata)
{
BZ_Free(tex->fallbackdata);
tex->fallbackdata = buf;
tex->fallbackfmt = format;
tex->fallbackwidth = imgwidth;
tex->fallbackheight = imgheight;
//now look in wad files and swap over the fallback. (halflife compatability)
COM_StripExtension(tex->ident, fname, sizeof(fname));
buf = W_GetTexture(fname, &imgwidth, &imgheight, &format);
if (buf)
{
BZ_Free(tex->fallbackdata);
tex->fallbackdata = buf;
tex->fallbackfmt = format;
tex->fallbackwidth = imgwidth;
tex->fallbackheight = imgheight;
}
}
if (tex->fallbackdata)