2011-12-30 18:20:28 +00:00
|
|
|
|
2011-12-12 12:44:17 +00:00
|
|
|
Index: Quake/gl_model.c
|
|
|
|
===================================================================
|
2017-09-03 14:55:18 +00:00
|
|
|
--- Quake/gl_model.c (revision 1463)
|
2011-12-12 12:44:17 +00:00
|
|
|
+++ Quake/gl_model.c (working copy)
|
2017-09-03 14:55:18 +00:00
|
|
|
@@ -429,6 +429,8 @@ void Mod_LoadTextures (lump_t *l)
|
2010-09-22 09:03:22 +00:00
|
|
|
extern byte *hunk_base;
|
|
|
|
//johnfitz
|
|
|
|
|
|
|
|
+ extern cvar_t r_externaltexture_fix; //mk
|
|
|
|
+
|
|
|
|
//johnfitz -- don't return early if no textures; still need to create dummy texture
|
|
|
|
if (!l->filelen)
|
|
|
|
{
|
2017-09-03 14:55:18 +00:00
|
|
|
@@ -490,7 +492,17 @@ void Mod_LoadTextures (lump_t *l)
|
2010-09-22 09:03:22 +00:00
|
|
|
if (!isDedicated) //no texture uploading for dedicated server
|
|
|
|
{
|
2013-09-25 17:01:40 +00:00
|
|
|
if (!q_strncasecmp(tx->name,"sky",3)) //sky texture //also note -- was Q_strncmp, changed to match qbsp
|
2010-09-22 09:03:22 +00:00
|
|
|
+ {
|
2011-12-12 12:44:17 +00:00
|
|
|
+ //mk -- begin
|
|
|
|
+ if (r_externaltexture_fix.value) {
|
2010-09-22 09:03:22 +00:00
|
|
|
+ if (strstr(tx->name,"sky4")) {
|
|
|
|
+ if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==13039)
|
2011-12-30 18:20:28 +00:00
|
|
|
+ q_strlcpy(tx->name, "sky1", sizeof(tx->name));
|
2010-09-22 09:03:22 +00:00
|
|
|
+ Con_Printf(" using %s\n", tx->name);
|
|
|
|
+ }
|
2011-12-12 12:44:17 +00:00
|
|
|
+ } //mk -- end
|
2010-09-22 09:03:22 +00:00
|
|
|
Sky_LoadTexture (tx);
|
2011-12-12 12:44:17 +00:00
|
|
|
+ }
|
2010-09-22 09:03:22 +00:00
|
|
|
else if (tx->name[0] == '*') //warping texture
|
|
|
|
{
|
|
|
|
//external textures -- first look in "textures/mapname/" then look in "textures/"
|
2017-09-03 14:55:18 +00:00
|
|
|
@@ -540,6 +552,52 @@ void Mod_LoadTextures (lump_t *l)
|
2010-09-22 09:03:22 +00:00
|
|
|
//external textures -- first look in "textures/mapname/" then look in "textures/"
|
|
|
|
mark = Hunk_LowMark ();
|
2011-12-30 18:20:28 +00:00
|
|
|
COM_StripExtension (loadmodel->name + 5, mapname, sizeof(mapname));
|
2010-09-22 09:03:22 +00:00
|
|
|
+ //mk begin
|
|
|
|
+ if (r_externaltexture_fix.value) {
|
|
|
|
+ if (strstr(tx->name,"plat_top1")) {
|
|
|
|
+ if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==24428)
|
2011-12-30 18:20:28 +00:00
|
|
|
+ q_strlcpy(tx->name, "plat_top1_cable", sizeof(tx->name));
|
2010-09-22 09:03:22 +00:00
|
|
|
+ else
|
2011-12-30 18:20:28 +00:00
|
|
|
+ q_strlcpy(tx->name, "plat_top1_bolt", sizeof(tx->name));
|
2010-09-22 09:03:22 +00:00
|
|
|
+ Con_Printf(" using %s\n", tx->name);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (strstr(tx->name,"metal5_2")) {
|
|
|
|
+ if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==49173)
|
2011-12-30 18:20:28 +00:00
|
|
|
+ q_strlcpy(tx->name, "metal5_2_x", sizeof(tx->name));
|
2010-09-22 09:03:22 +00:00
|
|
|
+ else
|
2011-12-30 18:20:28 +00:00
|
|
|
+ q_strlcpy(tx->name, "metal5_2_arc", sizeof(tx->name));
|
2010-09-22 09:03:22 +00:00
|
|
|
+ Con_Printf(" using %s\n", tx->name);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (strstr(tx->name,"metal5_4")) {
|
|
|
|
+ if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==20977)
|
2011-12-30 18:20:28 +00:00
|
|
|
+ q_strlcpy(tx->name, "metal5_4_double", sizeof(tx->name));
|
2010-09-22 09:03:22 +00:00
|
|
|
+ else
|
2011-12-30 18:20:28 +00:00
|
|
|
+ q_strlcpy(tx->name, "metal5_4_arc", sizeof(tx->name));
|
2010-09-22 09:03:22 +00:00
|
|
|
+ Con_Printf(" using %s\n", tx->name);
|
|
|
|
+ }
|
|
|
|
+ if (strstr(tx->name,"metal5_8")) {
|
|
|
|
+ if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==48444)
|
2011-12-30 18:20:28 +00:00
|
|
|
+ q_strlcpy(tx->name, "metal5_8_rune", sizeof(tx->name));
|
2010-09-22 09:03:22 +00:00
|
|
|
+ else
|
2011-12-30 18:20:28 +00:00
|
|
|
+ q_strlcpy(tx->name, "metal5_8_back", sizeof(tx->name));
|
2010-09-22 09:03:22 +00:00
|
|
|
+ Con_Printf(" using %s\n", tx->name);
|
|
|
|
+ }
|
|
|
|
+ if (strstr(tx->name,"metal5_8")) {
|
|
|
|
+ if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==48444)
|
2011-12-30 18:20:28 +00:00
|
|
|
+ q_strlcpy(tx->name, "metal5_8_rune", sizeof(tx->name));
|
2010-09-22 09:03:22 +00:00
|
|
|
+ else
|
2011-12-30 18:20:28 +00:00
|
|
|
+ q_strlcpy(tx->name, "metal5_8_back", sizeof(tx->name));
|
2010-09-22 09:03:22 +00:00
|
|
|
+ Con_Printf(" using %s\n", tx->name);
|
|
|
|
+ }
|
|
|
|
+ if (strstr(tx->name,"window03")) {
|
|
|
|
+ if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==63697) // e4m2 variant
|
2011-12-30 18:20:28 +00:00
|
|
|
+ q_strlcpy(tx->name, "window03_e4m2", sizeof(tx->name));
|
2010-09-22 09:03:22 +00:00
|
|
|
+ Con_Printf(" using %s\n", tx->name);
|
|
|
|
+ }
|
2011-12-12 12:44:17 +00:00
|
|
|
+ } //mk end
|
2010-09-22 09:03:22 +00:00
|
|
|
+
|
2011-12-30 18:20:28 +00:00
|
|
|
q_snprintf (filename, sizeof(filename), "textures/%s/%s", mapname, tx->name);
|
2010-09-22 09:03:22 +00:00
|
|
|
data = Image_LoadImage (filename, &fwidth, &fheight);
|
|
|
|
if (!data)
|
2011-12-12 12:44:17 +00:00
|
|
|
Index: Quake/gl_rmain.c
|
|
|
|
===================================================================
|
2017-09-03 14:55:18 +00:00
|
|
|
--- Quake/gl_rmain.c (revision 1406)
|
2011-12-12 12:44:17 +00:00
|
|
|
+++ Quake/gl_rmain.c (working copy)
|
2016-01-16 19:28:04 +00:00
|
|
|
@@ -101,6 +101,8 @@
|
|
|
|
|
2010-09-22 09:03:22 +00:00
|
|
|
extern cvar_t r_vfog;
|
|
|
|
//johnfitz
|
2016-01-16 19:28:04 +00:00
|
|
|
+
|
2011-12-30 18:20:28 +00:00
|
|
|
+cvar_t r_externaltexture_fix = {"r_externaltexture_fix","0", CVAR_ARCHIVE}; //mk
|
2010-09-22 09:03:22 +00:00
|
|
|
|
2014-09-22 09:37:23 +00:00
|
|
|
cvar_t gl_zfix = {"gl_zfix", "0", CVAR_NONE}; // QuakeSpasm z-fighting fix
|
2010-09-22 09:03:22 +00:00
|
|
|
|
2011-12-12 12:44:17 +00:00
|
|
|
Index: Quake/gl_rmisc.c
|
|
|
|
===================================================================
|
2017-09-03 14:55:18 +00:00
|
|
|
--- Quake/gl_rmisc.c (revision 1406)
|
2011-12-12 12:44:17 +00:00
|
|
|
+++ Quake/gl_rmisc.c (working copy)
|
2016-01-16 19:28:04 +00:00
|
|
|
@@ -47,6 +47,7 @@
|
|
|
|
extern cvar_t r_noshadow_list;
|
2010-09-22 09:03:22 +00:00
|
|
|
//johnfitz
|
2014-09-22 09:37:23 +00:00
|
|
|
extern cvar_t gl_zfix; // QuakeSpasm z-fighting fix
|
2010-09-22 09:03:22 +00:00
|
|
|
+extern cvar_t r_externaltexture_fix; //mk
|
|
|
|
|
2014-09-22 09:37:23 +00:00
|
|
|
extern gltexture_t *playertextures[MAX_SCOREBOARD]; //johnfitz
|
2011-12-12 12:44:17 +00:00
|
|
|
|
2016-01-16 19:28:04 +00:00
|
|
|
@@ -231,6 +232,7 @@ void R_Init (void)
|
|
|
|
Cvar_RegisterVariable (&r_noshadow_list);
|
|
|
|
Cvar_SetCallback (&r_noshadow_list, R_Model_ExtraFlags_List_f);
|
2010-09-22 09:03:22 +00:00
|
|
|
//johnfitz
|
2011-12-30 18:20:28 +00:00
|
|
|
+ Cvar_RegisterVariable (&r_externaltexture_fix); //mk
|
2010-09-22 09:03:22 +00:00
|
|
|
|
2011-12-30 18:20:28 +00:00
|
|
|
Cvar_RegisterVariable (&gl_zfix); // QuakeSpasm z-fighting fix
|
2016-01-16 19:28:04 +00:00
|
|
|
Cvar_RegisterVariable (&r_lavaalpha);
|
2011-12-12 12:44:17 +00:00
|
|
|
|