diff --git a/engine/client/image.c b/engine/client/image.c index e0b929484..a0ce582de 100644 --- a/engine/client/image.c +++ b/engine/client/image.c @@ -9,6 +9,9 @@ cvar_t r_dodgytgafiles = {"r_dodgytgafiles", "0"}; //Certain tgas are upside dow //but some people have gone and 'fixed' those broken ones by flipping. //these images appear upside down in any editor but correct in tenebrae //set this to 1 to emulate tenebrae's bug. +cvar_t r_dodgypcxfiles = {"r_dodgypcxfiles", "0"}; //Quake 2's PCX loading isn't complete, + //and some Q2 mods include PCX files + //that only work with this assumption #ifndef _WIN32 #include @@ -1211,7 +1214,10 @@ qbyte *ReadPCXFile(qbyte *buf, int length, int *width, int *height) *width = xmax-xmin+1; *height = ymax-ymin+1; - palette = buf + length-768; + if (r_dodgypcxfiles.value) + palette = host_basepal; + else + palette = buf + length-768; data = (char *)(pcx+1); diff --git a/engine/client/renderer.c b/engine/client/renderer.c index 37fd55706..4c2e6b307 100644 --- a/engine/client/renderer.c +++ b/engine/client/renderer.c @@ -57,6 +57,7 @@ cvar_t gl_skyboxdist = {"gl_skyboxdist", "2300"}; cvar_t r_vertexdlights = {"r_vertexdlights", "1"}; extern cvar_t r_dodgytgafiles; +extern cvar_t r_dodgypcxfiles; cvar_t r_nolerp = {"r_nolerp", "0"}; cvar_t r_nolightdir = {"r_nolightdir", "0"}; @@ -464,6 +465,7 @@ void Renderer_Init(void) Cvar_Register (&gl_skyboxname, GRAPHICALNICETIES); Cvar_Register(&r_dodgytgafiles, "Bug fixes"); + Cvar_Register(&r_dodgypcxfiles, "Bug fixes"); Cvar_Register(&r_loadlits, GRAPHICALNICETIES); Cvar_Register(&r_lightstylesmooth, GRAPHICALNICETIES); Cvar_Register(&r_lightstylespeed, GRAPHICALNICETIES);