]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - image.c
use cl.worldmodel in r_editlights_reload code as it is invoked from the
[xonotic/darkplaces.git] / image.c
diff --git a/image.c b/image.c
index b41f780141bc1c940451936590bb00e877ada4d0..2146a64758756dbde6d5dc1ad2170f2c4af1aae2 100644 (file)
--- a/image.c
+++ b/image.c
@@ -327,14 +327,15 @@ unsigned char *LoadTGA_BGRA (const unsigned char *f, int filesize)
        targa_header.y_origin = f[10] + f[11] * 256;
        targa_header.width = image_width = f[12] + f[13] * 256;
        targa_header.height = image_height = f[14] + f[15] * 256;
+       targa_header.pixel_size = f[16];
+       targa_header.attributes = f[17];
+
        if (image_width > 4096 || image_height > 4096 || image_width <= 0 || image_height <= 0)
        {
                Con_Print("LoadTGA: invalid size\n");
                PrintTargaHeader(&targa_header);
                return NULL;
        }
-       targa_header.pixel_size = f[16];
-       targa_header.attributes = f[17];
 
        // advance to end of header
        fin = f + 18;
@@ -720,6 +721,20 @@ imageformat_t imageformats_nopath[] =
        {NULL, NULL}
 };
 
+// GAME_DELUXEQUAKE only
+// VorteX: the point why i use such messy texture paths is
+// that GtkRadiant can't detect normal/gloss textures
+// and exclude them from texture browser
+// so i just use additional folder to store this textures
+imageformat_t imageformats_dq[] =
+{
+       {"%s.tga", LoadTGA_BGRA},
+       {"%s.jpg", JPEG_LoadImage_BGRA},
+       {"texturemaps/%s.tga", LoadTGA_BGRA},
+       {"texturemaps/%s.jpg", JPEG_LoadImage_BGRA},
+       {NULL, NULL}
+};
+
 imageformat_t imageformats_textures[] =
 {
        {"%s.tga", LoadTGA_BGRA},
@@ -774,6 +789,8 @@ unsigned char *loadimagepixelsbgra (const char *filename, qboolean complain, qbo
        }
        if (gamemode == GAME_TENEBRAE)
                firstformat = imageformats_tenebrae;
+       else if (gamemode == GAME_DELUXEQUAKE)
+               firstformat = imageformats_dq;
        else if (!strcasecmp(name, "textures"))
                firstformat = imageformats_textures;
        else if (!strcasecmp(name, "gfx"))