From 6700dfd28972301791d650ccf69186e090951425 Mon Sep 17 00:00:00 2001 From: Spoike Date: Mon, 9 Jan 2023 05:13:05 +0000 Subject: [PATCH] Fix _bump texture loading. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@6321 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/image.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/engine/client/image.c b/engine/client/image.c index d1f33518a..14e9a3a81 100644 --- a/engine/client/image.c +++ b/engine/client/image.c @@ -303,6 +303,8 @@ static void GenerateXMPData(char *blob, size_t blobsize, int width, int height, "" "" ); +#else + blob[blobsize] = 0; #endif } #endif @@ -514,7 +516,7 @@ void *ReadTargaFile(qbyte *buf, int length, int *width, int *height, uploadfmt_t if (greyonly) //grey only, load as 8 bit.. { - if (!(tgaheader.version == 1) && !(tgaheader.version == 3)) + if (!(tgaheader.version == 1) && !(tgaheader.version == 3) && !(tgaheader.version == 11)) return NULL; } if (tgaheader.version == 1 || tgaheader.version == 3) @@ -13893,8 +13895,6 @@ qboolean Image_LocateHighResTexture(image_t *tex, flocation_t *bestloc, char *be if (!strcmp(tex_extensions[e].name, ".tga")) { Q_snprintfz(fname, sizeof(fname), tex_path[i].path, bumpname, tex_extensions[e].name); - - Q_snprintfz(fname, sizeof(fname), tex_path[i].path, nicename, tex_extensions[e].name); depth = FS_FLocateFile(fname, locflags, &loc); if (depth < bestdepth) { @@ -14085,6 +14085,8 @@ static void Image_LoadHiResTextureWorker(void *ctx, void *data, size_t a, size_t return; } } + else + Con_Printf(CON_WARNING "%s: bumpmaps must be greyscale tga.\n", fname); //guess not, fall back to normalmaps } #endif