mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 07:21:58 +00:00
re-diff'ed extra patches under Misc/ so that they apply cleanly.
This commit is contained in:
parent
7ff5902881
commit
6c8652dd5b
2 changed files with 38 additions and 42 deletions
|
@ -1,10 +1,10 @@
|
|||
allow plain files to override files inside a PAK file -- Sander van Dijk.
|
||||
|
||||
Index: Quake/common.c
|
||||
===================================================================
|
||||
--- Quake/common.c (revision 1476)
|
||||
+++ Quake/common.c (working copy)
|
||||
@@ -2036,13 +2036,6 @@ static void COM_AddGameDirectory (const
|
||||
diff --git a/Quake/common.c b/Quake/common.c
|
||||
index 6206c3f..27833b8 100644
|
||||
--- a/Quake/common.c
|
||||
+++ b/Quake/common.c
|
||||
@@ -2037,13 +2037,6 @@ static void COM_AddGameDirectory (const char *base, const char *dir)
|
||||
else path_id = 1U;
|
||||
|
||||
_add_path:
|
||||
|
@ -18,7 +18,7 @@ Index: Quake/common.c
|
|||
// add any pak files in the format pak0.pak pak1.pak, ...
|
||||
for (i = 0; ; i++)
|
||||
{
|
||||
@@ -2074,6 +2067,13 @@ _add_path:
|
||||
@@ -2075,6 +2068,13 @@ _add_path:
|
||||
if (!pak) break;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,41 +1,39 @@
|
|||
|
||||
Index: Quake/gl_model.c
|
||||
===================================================================
|
||||
--- Quake/gl_model.c (revision 1463)
|
||||
+++ Quake/gl_model.c (working copy)
|
||||
@@ -429,6 +429,8 @@ void Mod_LoadTextures (lump_t *l)
|
||||
extern byte *hunk_base;
|
||||
//johnfitz
|
||||
diff --git a/Quake/gl_model.c b/Quake/gl_model.c
|
||||
index 2b15080..07ff6fd 100644
|
||||
--- a/Quake/gl_model.c
|
||||
+++ b/Quake/gl_model.c
|
||||
@@ -37,6 +37,8 @@ qmodel_t *Mod_LoadModel (qmodel_t *mod, qboolean crash);
|
||||
cvar_t external_ents = {"external_ents", "1", CVAR_ARCHIVE};
|
||||
cvar_t external_vis = {"external_vis", "1", CVAR_ARCHIVE};
|
||||
|
||||
+ extern cvar_t r_externaltexture_fix; //mk
|
||||
+extern cvar_t r_externaltexture_fix; //mk
|
||||
+
|
||||
//johnfitz -- don't return early if no textures; still need to create dummy texture
|
||||
if (!l->filelen)
|
||||
{
|
||||
@@ -490,7 +492,17 @@ void Mod_LoadTextures (lump_t *l)
|
||||
static byte *mod_novis;
|
||||
static int mod_novis_capacity;
|
||||
|
||||
@@ -498,7 +500,16 @@ void Mod_LoadTextures (lump_t *l)
|
||||
if (!isDedicated) //no texture uploading for dedicated server
|
||||
{
|
||||
if (!q_strncasecmp(tx->name,"sky",3)) //sky texture //also note -- was Q_strncmp, changed to match qbsp
|
||||
+ {
|
||||
+ //mk -- begin
|
||||
+ if (r_externaltexture_fix.value) {
|
||||
+ if (r_externaltexture_fix.value) { //mk
|
||||
+ if (strstr(tx->name,"sky4")) {
|
||||
+ if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==13039)
|
||||
+ q_strlcpy(tx->name, "sky1", sizeof(tx->name));
|
||||
+ Con_Printf(" using %s\n", tx->name);
|
||||
+ }
|
||||
+ } //mk -- end
|
||||
+ }
|
||||
Sky_LoadTexture (tx);
|
||||
+ }
|
||||
else if (tx->name[0] == '*') //warping texture
|
||||
{
|
||||
//external textures -- first look in "textures/mapname/" then look in "textures/"
|
||||
@@ -540,6 +552,52 @@ void Mod_LoadTextures (lump_t *l)
|
||||
@@ -548,6 +559,50 @@ void Mod_LoadTextures (lump_t *l)
|
||||
//external textures -- first look in "textures/mapname/" then look in "textures/"
|
||||
mark = Hunk_LowMark ();
|
||||
COM_StripExtension (loadmodel->name + 5, mapname, sizeof(mapname));
|
||||
+ //mk begin
|
||||
+ if (r_externaltexture_fix.value) {
|
||||
+
|
||||
+ if (r_externaltexture_fix.value) { //mk
|
||||
+ if (strstr(tx->name,"plat_top1")) {
|
||||
+ if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==24428)
|
||||
+ q_strlcpy(tx->name, "plat_top1_cable", sizeof(tx->name));
|
||||
|
@ -43,7 +41,6 @@ Index: Quake/gl_model.c
|
|||
+ q_strlcpy(tx->name, "plat_top1_bolt", sizeof(tx->name));
|
||||
+ Con_Printf(" using %s\n", tx->name);
|
||||
+ }
|
||||
+
|
||||
+ if (strstr(tx->name,"metal5_2")) {
|
||||
+ if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==49173)
|
||||
+ q_strlcpy(tx->name, "metal5_2_x", sizeof(tx->name));
|
||||
|
@ -51,7 +48,6 @@ Index: Quake/gl_model.c
|
|||
+ q_strlcpy(tx->name, "metal5_2_arc", sizeof(tx->name));
|
||||
+ Con_Printf(" using %s\n", tx->name);
|
||||
+ }
|
||||
+
|
||||
+ if (strstr(tx->name,"metal5_4")) {
|
||||
+ if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==20977)
|
||||
+ q_strlcpy(tx->name, "metal5_4_double", sizeof(tx->name));
|
||||
|
@ -78,29 +74,29 @@ Index: Quake/gl_model.c
|
|||
+ q_strlcpy(tx->name, "window03_e4m2", sizeof(tx->name));
|
||||
+ Con_Printf(" using %s\n", tx->name);
|
||||
+ }
|
||||
+ } //mk end
|
||||
+ }
|
||||
+
|
||||
q_snprintf (filename, sizeof(filename), "textures/%s/%s", mapname, tx->name);
|
||||
data = Image_LoadImage (filename, &fwidth, &fheight);
|
||||
if (!data)
|
||||
Index: Quake/gl_rmain.c
|
||||
===================================================================
|
||||
--- Quake/gl_rmain.c (revision 1406)
|
||||
+++ Quake/gl_rmain.c (working copy)
|
||||
@@ -101,6 +101,8 @@
|
||||
|
||||
diff --git a/Quake/gl_rmain.c b/Quake/gl_rmain.c
|
||||
index a41d8b1..b0020c5 100644
|
||||
--- a/Quake/gl_rmain.c
|
||||
+++ b/Quake/gl_rmain.c
|
||||
@@ -102,6 +102,8 @@ cvar_t r_noshadow_list = {"r_noshadow_list", "progs/flame2.mdl,progs/flame.mdl,p
|
||||
extern cvar_t r_vfog;
|
||||
//johnfitz
|
||||
+
|
||||
+cvar_t r_externaltexture_fix = {"r_externaltexture_fix","0", CVAR_ARCHIVE}; //mk
|
||||
|
||||
+cvar_t r_externaltexture_fix = {"r_externaltexture_fix", "0", CVAR_ARCHIVE}; //mk
|
||||
+
|
||||
cvar_t gl_zfix = {"gl_zfix", "0", CVAR_NONE}; // QuakeSpasm z-fighting fix
|
||||
|
||||
Index: Quake/gl_rmisc.c
|
||||
===================================================================
|
||||
--- Quake/gl_rmisc.c (revision 1406)
|
||||
+++ Quake/gl_rmisc.c (working copy)
|
||||
@@ -47,6 +47,7 @@
|
||||
cvar_t r_lavaalpha = {"r_lavaalpha","0",CVAR_NONE};
|
||||
diff --git a/Quake/gl_rmisc.c b/Quake/gl_rmisc.c
|
||||
index dfdb84d..9c441bd 100644
|
||||
--- a/Quake/gl_rmisc.c
|
||||
+++ b/Quake/gl_rmisc.c
|
||||
@@ -47,6 +47,7 @@ extern cvar_t r_nolerp_list;
|
||||
extern cvar_t r_noshadow_list;
|
||||
//johnfitz
|
||||
extern cvar_t gl_zfix; // QuakeSpasm z-fighting fix
|
||||
|
@ -108,7 +104,7 @@ Index: Quake/gl_rmisc.c
|
|||
|
||||
extern gltexture_t *playertextures[MAX_SCOREBOARD]; //johnfitz
|
||||
|
||||
@@ -231,6 +232,7 @@ void R_Init (void)
|
||||
@@ -218,6 +219,7 @@ void R_Init (void)
|
||||
Cvar_RegisterVariable (&r_noshadow_list);
|
||||
Cvar_SetCallback (&r_noshadow_list, R_Model_ExtraFlags_List_f);
|
||||
//johnfitz
|
||||
|
|
Loading…
Reference in a new issue