]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix loading of quake lmp/wad textures
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 3 May 2011 18:03:22 +0000 (18:03 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Wed, 4 May 2011 05:37:21 +0000 (07:37 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11098 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=97d3f3a9721b9a5e696adb4262e7d3b3964ef892

gl_draw.c

index 2e1ce7a65d3c1779cbf2a1ca0c0d5e0547cf35a7..1f179bc41bd6b26f260a23371846b2ca7405338e 100644 (file)
--- 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);
+                       }
                }
        }