From 0c41ac0b7df911314a5eaf1e3c12e9abf713d6e6 Mon Sep 17 00:00:00 2001 From: Spoike Date: Mon, 21 Jun 2021 15:03:04 +0000 Subject: [PATCH] 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 --- engine/client/image.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/engine/client/image.c b/engine/client/image.c index 6a5cbd6c..562320db 100644 --- a/engine/client/image.c +++ b/engine/client/image.c @@ -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)