]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - wad.c
centralized GL_VENDOR/GL_RENDERER/etc printing code
[xonotic/darkplaces.git] / wad.c
diff --git a/wad.c b/wad.c
index 60cabff9b0b36ba49dc5d543a42a63730cc79b40..23c0b6e6f13991133bc4014abdf3aeb2b98a009a 100644 (file)
--- a/wad.c
+++ b/wad.c
@@ -148,11 +148,6 @@ unsigned char *W_GetLumpName(const char *name)
        for (lump = wad.gfx.lumps, i = 0;i < wad.gfx.numlumps;i++, lump++)
                if (!strcmp(clean, lump->name))
                        return (wad.gfx_base + lump->filepos);
-
-       if (wad.gfx_base)
-               Con_DPrintf("W_GetLumpByName(\"%s\"): couldn't find file in gfx.wad\n", name);
-       else
-               Con_DPrintf("W_GetLumpByName(\"%s\"): couldn't load gfx.wad\n", name);
        return NULL;
 }
 
@@ -222,7 +217,7 @@ void W_LoadTextureWadFile (char *filename, int complain)
        // leaves the file open
 }
 
-unsigned char *W_ConvertWAD3Texture(miptex_t *tex)
+unsigned char *W_ConvertWAD3TextureBGRA(miptex_t *tex)
 {
        unsigned char *in, *data, *out, *pal;
        int d, p;
@@ -243,9 +238,9 @@ unsigned char *W_ConvertWAD3Texture(miptex_t *tex)
                else
                {
                        p *= 3;
-                       out[0] = pal[p];
+                       out[2] = pal[p];
                        out[1] = pal[p+1];
-                       out[2] = pal[p+2];
+                       out[0] = pal[p+2];
                        out[3] = 255;
                }
                out += 4;
@@ -253,7 +248,7 @@ unsigned char *W_ConvertWAD3Texture(miptex_t *tex)
        return data;
 }
 
-unsigned char *W_GetTexture(char *name)
+unsigned char *W_GetTextureBGRA(char *name)
 {
        unsigned int i, j, k;
        miptex_t *tex;
@@ -287,7 +282,7 @@ unsigned char *W_GetTexture(char *name)
                                tex->height = LittleLong(tex->height);
                                for (j = 0;j < MIPLEVELS;j++)
                                        tex->offsets[j] = LittleLong(tex->offsets[j]);
-                               data = W_ConvertWAD3Texture(tex);
+                               data = W_ConvertWAD3TextureBGRA(tex);
                                Mem_Free(tex);
                                return data;
                        }