From 7c35e317ff4ee3d8d4961a85cadb949abaac66d2 Mon Sep 17 00:00:00 2001 From: havoc Date: Tue, 3 May 2011 18:03:22 +0000 Subject: [PATCH] fix loading of quake lmp/wad textures git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11098 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=97d3f3a9721b9a5e696adb4262e7d3b3964ef892 --- gl_draw.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/gl_draw.c b/gl_draw.c index 2e1ce7a6..1f179bc4 100644 --- a/gl_draw.c +++ b/gl_draw.c @@ -431,8 +431,11 @@ reload: pic->width = lmpdata[0] + lmpdata[1] * 256 + lmpdata[2] * 65536 + lmpdata[3] * 16777216; pic->height = lmpdata[4] + lmpdata[5] * 256 + lmpdata[6] * 65536 + lmpdata[7] * 16777216; // if no high quality replacement image was found, upload the original low quality texture - if (!pixels) + if (!loaded) + { + loaded = true; pic->tex = R_LoadTexture2D(drawtexturepool, pic->name, pic->width, pic->height, lmpdata + 8, TEXTYPE_PALETTE, pic->texflags, -1, palette_bgra_transparent); + } } Mem_Free(lmpdata); } @@ -447,16 +450,22 @@ reload: pic->width = 128; pic->height = 128; // if no high quality replacement image was found, upload the original low quality texture - if (!pixels) + if (!loaded) + { + loaded = true; pic->tex = R_LoadTexture2D(drawtexturepool, pic->name, 128, 128, lmpdata, TEXTYPE_PALETTE, pic->texflags, -1, palette_bgra_font); + } } else { pic->width = lmpdata[0] + lmpdata[1] * 256 + lmpdata[2] * 65536 + lmpdata[3] * 16777216; pic->height = lmpdata[4] + lmpdata[5] * 256 + lmpdata[6] * 65536 + lmpdata[7] * 16777216; // if no high quality replacement image was found, upload the original low quality texture - if (!pixels) + if (!loaded) + { + loaded = true; pic->tex = R_LoadTexture2D(drawtexturepool, pic->name, pic->width, pic->height, lmpdata + 8, TEXTYPE_PALETTE, pic->texflags, -1, palette_bgra_transparent); + } } } -- 2.39.2