From: havoc Date: Tue, 3 May 2011 18:03:22 +0000 (+0000) Subject: fix loading of quake lmp/wad textures X-Git-Tag: xonotic-v0.6.0~163^2~448 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=97d3f3a9721b9a5e696adb4262e7d3b3964ef892;p=xonotic%2Fdarkplaces.git fix loading of quake lmp/wad textures git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11098 d7cf8633-e32d-0410-b094-e92efae38249 --- 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); + } } }