rediffed and adjusted the Misc/* extra patches so that they apply and compile

correctly.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@589 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2011-12-30 18:20:28 +00:00
parent d36de568a3
commit 7f78c093b7
2 changed files with 51 additions and 51 deletions

View File

@ -1,12 +1,11 @@
support for user directories, based on uhexen2 and tyrquake. support for user directories, based on uhexen2 and tyrquake:
** against quakespasm svn revision 496. ** against quakespasm svn revision 588.
** in alpha state, minimally tested. ** on-the-fly game directory switching not supported yet.
** on-the-fly game directory changes not supported yet. ** minimally tested, needs more work.
** needs more work.
Index: Quake/sys_sdl_unix.c Index: Quake/sys_sdl_unix.c
=================================================================== ===================================================================
--- Quake/sys_sdl_unix.c (revision 496) --- Quake/sys_sdl_unix.c (revision 588)
+++ Quake/sys_sdl_unix.c (working copy) +++ Quake/sys_sdl_unix.c (working copy)
@@ -20,6 +20,8 @@ @@ -20,6 +20,8 @@
@ -74,14 +73,14 @@ Index: Quake/sys_sdl_unix.c
void Sys_mkdir (const char *path) void Sys_mkdir (const char *path)
Index: Quake/common.c Index: Quake/common.c
=================================================================== ===================================================================
--- Quake/common.c (revision 496) --- Quake/common.c (revision 588)
+++ Quake/common.c (working copy) +++ Quake/common.c (working copy)
@@ -1822,32 +1822,34 @@ @@ -1846,32 +1846,34 @@ pack_t *COM_LoadPackFile (const char *pa
COM_AddGameDirectory -- johnfitz -- modified based on topaz's tutorial COM_AddGameDirectory -- johnfitz -- modified based on topaz's tutorial
================= =================
*/ */
-void COM_AddGameDirectory (const char *dir) -static void COM_AddGameDirectory (const char *dir)
+void COM_AddGameDirectory (const char *base, const char *dir) +static void COM_AddGameDirectory (const char *base, const char *dir)
{ {
int i; int i;
unsigned int path_id; unsigned int path_id;
@ -90,8 +89,8 @@ Index: Quake/common.c
char pakfile[MAX_OSPATH]; char pakfile[MAX_OSPATH];
+ qboolean been_here = false; + qboolean been_here = false;
- strcpy (com_gamedir, dir); - q_strlcpy (com_gamedir, dir, sizeof(com_gamedir));
+ strcpy (com_gamedir, va("%s/%s", base, dir)); + q_strlcpy (com_gamedir, va("%s/%s", base, dir), sizeof(com_gamedir));
// assign a path_id to this game directory // assign a path_id to this game directory
if (com_searchpaths) if (com_searchpaths)
@ -102,20 +101,20 @@ Index: Quake/common.c
// add the directory to the search path // add the directory to the search path
search = (searchpath_t *) Z_Malloc(sizeof(searchpath_t)); search = (searchpath_t *) Z_Malloc(sizeof(searchpath_t));
search->path_id = path_id; search->path_id = path_id;
- strcpy (search->filename, dir); - q_strlcpy (search->filename, dir, sizeof(search->filename));
+ strcpy (search->filename, com_gamedir); + q_strlcpy (search->filename, com_gamedir, sizeof(search->filename));
search->next = com_searchpaths; search->next = com_searchpaths;
com_searchpaths = search; com_searchpaths = search;
// add any pak files in the format pak0.pak pak1.pak, ... // add any pak files in the format pak0.pak pak1.pak, ...
for (i = 0; ; i++) for (i = 0; ; i++)
{ {
- sprintf (pakfile, "%s/pak%i.pak", dir, i); - q_snprintf (pakfile, sizeof(pakfile), "%s/pak%i.pak", dir, i);
+ sprintf (pakfile, "%s/pak%i.pak", com_gamedir, i); + q_snprintf (pakfile, sizeof(pakfile), "%s/pak%i.pak", com_gamedir, i);
pak = COM_LoadPackFile (pakfile); pak = COM_LoadPackFile (pakfile);
if (!pak) if (!pak)
break; break;
@@ -1857,6 +1859,14 @@ @@ -1881,6 +1883,14 @@ static void COM_AddGameDirectory (const
search->next = com_searchpaths; search->next = com_searchpaths;
com_searchpaths = search; com_searchpaths = search;
} }
@ -123,24 +122,24 @@ Index: Quake/common.c
+ if (!been_here && host_parms->userdir != host_parms->basedir) + if (!been_here && host_parms->userdir != host_parms->basedir)
+ { + {
+ been_here = true; + been_here = true;
+ strcpy(com_gamedir, va("%s/%s", host_parms->userdir, dir)); + q_strlcpy(com_gamedir, va("%s/%s", host_parms->userdir, dir), sizeof(com_gamedir));
+ Sys_mkdir(com_gamedir); + Sys_mkdir(com_gamedir);
+ goto _add_path; + goto _add_path;
+ } + }
} }
#if defined(USE_QS_CONBACK) #if defined(USE_QS_CONBACK)
@@ -1907,8 +1917,7 @@ @@ -1935,8 +1945,7 @@ void COM_InitFilesystem (void) //johnfit
} }
// start up with GAMENAME by default (id1) // start up with GAMENAME by default (id1)
- COM_AddGameDirectory (va("%s/"GAMENAME, com_basedir)); - COM_AddGameDirectory (va("%s/"GAMENAME, com_basedir));
- strcpy (com_gamedir, va("%s/"GAMENAME, com_basedir)); - q_strlcpy (com_gamedir, va("%s/"GAMENAME, com_basedir), sizeof(com_gamedir));
+ COM_AddGameDirectory (com_basedir, GAMENAME); + COM_AddGameDirectory (com_basedir, GAMENAME);
#if defined(USE_QS_CONBACK) #if defined(USE_QS_CONBACK)
if (!fitzmode) if (!fitzmode)
@@ -1922,17 +1931,17 @@ @@ -1950,17 +1959,17 @@ void COM_InitFilesystem (void) //johnfit
com_nummissionpacks = 0; com_nummissionpacks = 0;
if (COM_CheckParm ("-rogue")) if (COM_CheckParm ("-rogue"))
{ {
@ -161,12 +160,12 @@ Index: Quake/common.c
com_nummissionpacks++; com_nummissionpacks++;
} }
//johnfitz //johnfitz
@@ -1941,7 +1950,7 @@ @@ -1969,7 +1978,7 @@ void COM_InitFilesystem (void) //johnfit
if (i && i < com_argc-1) if (i && i < com_argc-1)
{ {
com_modified = true; com_modified = true;
- COM_AddGameDirectory (va("%s/%s", com_basedir, com_argv[i + 1])); - COM_AddGameDirectory (va("%s/%s", com_basedir, com_argv[i + 1]));
+ COM_AddGameDirectory (com_basedir, com_argv[i + 1]); + COM_AddGameDirectory (com_basedir, com_argv[i + 1]);
} }
}
COM_CheckRegistered ();

View File

@ -1,8 +1,9 @@
Index: Quake/gl_model.c Index: Quake/gl_model.c
=================================================================== ===================================================================
--- Quake/gl_model.c (revision 508) --- Quake/gl_model.c (revision 588)
+++ Quake/gl_model.c (working copy) +++ Quake/gl_model.c (working copy)
@@ -386,6 +386,8 @@ void Mod_LoadTextures (lump_t *l) @@ -387,6 +387,8 @@ void Mod_LoadTextures (lump_t *l)
extern byte *hunk_base; extern byte *hunk_base;
//johnfitz //johnfitz
@ -11,7 +12,7 @@ Index: Quake/gl_model.c
//johnfitz -- don't return early if no textures; still need to create dummy texture //johnfitz -- don't return early if no textures; still need to create dummy texture
if (!l->filelen) if (!l->filelen)
{ {
@@ -437,7 +439,17 @@ void Mod_LoadTextures (lump_t *l) @@ -438,7 +440,17 @@ void Mod_LoadTextures (lump_t *l)
if (!isDedicated) //no texture uploading for dedicated server 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 if (!Q_strncasecmp(tx->name,"sky",3)) //sky texture //also note -- was Q_strncmp, changed to match qbsp
@ -20,7 +21,7 @@ Index: Quake/gl_model.c
+ if (r_externaltexture_fix.value) { + if (r_externaltexture_fix.value) {
+ if (strstr(tx->name,"sky4")) { + if (strstr(tx->name,"sky4")) {
+ if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==13039) + if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==13039)
+ strcpy(tx->name,"sky1"); + q_strlcpy(tx->name, "sky1", sizeof(tx->name));
+ Con_Printf(" using %s\n", tx->name); + Con_Printf(" using %s\n", tx->name);
+ } + }
+ } //mk -- end + } //mk -- end
@ -29,74 +30,74 @@ Index: Quake/gl_model.c
else if (tx->name[0] == '*') //warping texture else if (tx->name[0] == '*') //warping texture
{ {
//external textures -- first look in "textures/mapname/" then look in "textures/" //external textures -- first look in "textures/mapname/" then look in "textures/"
@@ -479,6 +491,52 @@ void Mod_LoadTextures (lump_t *l) @@ -480,6 +492,52 @@ void Mod_LoadTextures (lump_t *l)
//external textures -- first look in "textures/mapname/" then look in "textures/" //external textures -- first look in "textures/mapname/" then look in "textures/"
mark = Hunk_LowMark (); mark = Hunk_LowMark ();
COM_StripExtension (loadmodel->name + 5, mapname); COM_StripExtension (loadmodel->name + 5, mapname, sizeof(mapname));
+ //mk begin + //mk begin
+ if (r_externaltexture_fix.value) { + if (r_externaltexture_fix.value) {
+ if (strstr(tx->name,"plat_top1")) { + if (strstr(tx->name,"plat_top1")) {
+ if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==24428) + if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==24428)
+ strcpy(tx->name,"plat_top1_cable"); + q_strlcpy(tx->name, "plat_top1_cable", sizeof(tx->name));
+ else + else
+ strcpy(tx->name,"plat_top1_bolt"); + q_strlcpy(tx->name, "plat_top1_bolt", sizeof(tx->name));
+ Con_Printf(" using %s\n", tx->name); + Con_Printf(" using %s\n", tx->name);
+ } + }
+ +
+ if (strstr(tx->name,"metal5_2")) { + if (strstr(tx->name,"metal5_2")) {
+ if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==49173) + if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==49173)
+ strcpy(tx->name,"metal5_2_x"); + q_strlcpy(tx->name, "metal5_2_x", sizeof(tx->name));
+ else + else
+ strcpy(tx->name,"metal5_2_arc"); + q_strlcpy(tx->name, "metal5_2_arc", sizeof(tx->name));
+ Con_Printf(" using %s\n", tx->name); + Con_Printf(" using %s\n", tx->name);
+ } + }
+ +
+ if (strstr(tx->name,"metal5_4")) { + if (strstr(tx->name,"metal5_4")) {
+ if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==20977) + if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==20977)
+ strcpy(tx->name,"metal5_4_double"); + q_strlcpy(tx->name, "metal5_4_double", sizeof(tx->name));
+ else + else
+ strcpy(tx->name,"metal5_4_arc"); + q_strlcpy(tx->name, "metal5_4_arc", sizeof(tx->name));
+ Con_Printf(" using %s\n", tx->name); + Con_Printf(" using %s\n", tx->name);
+ } + }
+ if (strstr(tx->name,"metal5_8")) { + if (strstr(tx->name,"metal5_8")) {
+ if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==48444) + if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==48444)
+ strcpy(tx->name,"metal5_8_rune"); + q_strlcpy(tx->name, "metal5_8_rune", sizeof(tx->name));
+ else + else
+ strcpy(tx->name,"metal5_8_back"); + q_strlcpy(tx->name, "metal5_8_back", sizeof(tx->name));
+ Con_Printf(" using %s\n", tx->name); + Con_Printf(" using %s\n", tx->name);
+ } + }
+ if (strstr(tx->name,"metal5_8")) { + if (strstr(tx->name,"metal5_8")) {
+ if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==48444) + if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==48444)
+ strcpy(tx->name,"metal5_8_rune"); + q_strlcpy(tx->name, "metal5_8_rune", sizeof(tx->name));
+ else + else
+ strcpy(tx->name,"metal5_8_back"); + q_strlcpy(tx->name, "metal5_8_back", sizeof(tx->name));
+ Con_Printf(" using %s\n", tx->name); + Con_Printf(" using %s\n", tx->name);
+ } + }
+ if (strstr(tx->name,"window03")) { + if (strstr(tx->name,"window03")) {
+ if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==63697) // e4m2 variant + if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==63697) // e4m2 variant
+ strcpy(tx->name,"window03_e4m2"); + q_strlcpy(tx->name, "window03_e4m2", sizeof(tx->name));
+ Con_Printf(" using %s\n", tx->name); + Con_Printf(" using %s\n", tx->name);
+ } + }
+ } //mk end + } //mk end
+ +
sprintf (filename, "textures/%s/%s", mapname, tx->name); q_snprintf (filename, sizeof(filename), "textures/%s/%s", mapname, tx->name);
data = Image_LoadImage (filename, &fwidth, &fheight); data = Image_LoadImage (filename, &fwidth, &fheight);
if (!data) if (!data)
Index: Quake/gl_rmain.c Index: Quake/gl_rmain.c
=================================================================== ===================================================================
--- Quake/gl_rmain.c (revision 508) --- Quake/gl_rmain.c (revision 588)
+++ Quake/gl_rmain.c (working copy) +++ Quake/gl_rmain.c (working copy)
@@ -102,6 +102,7 @@ @@ -102,6 +102,7 @@
cvar_t r_nolerp_list = {"r_nolerp_list", "progs/flame.mdl,progs/flame2.mdl,progs/braztall.mdl,progs/brazshrt.mdl,progs/longtrch.mdl,progs/flame_pyre.mdl,progs/v_saw.mdl,progs/v_xfist.mdl,progs/h2stuff/newfire.mdl"}; cvar_t r_nolerp_list = {"r_nolerp_list", "progs/flame.mdl,progs/flame2.mdl,progs/braztall.mdl,progs/brazshrt.mdl,progs/longtrch.mdl,progs/flame_pyre.mdl,progs/v_saw.mdl,progs/v_xfist.mdl,progs/h2stuff/newfire.mdl", CVAR_NONE};
extern cvar_t r_vfog; extern cvar_t r_vfog;
//johnfitz //johnfitz
+cvar_t r_externaltexture_fix = {"r_externaltexture_fix","0", true}; //mk +cvar_t r_externaltexture_fix = {"r_externaltexture_fix","0", CVAR_ARCHIVE}; //mk
cvar_t gl_zfix = {"gl_zfix", "1", true}; // QuakeSpasm z-fighting fix cvar_t gl_zfix = {"gl_zfix", "1", CVAR_ARCHIVE}; // QuakeSpasm z-fighting fix
Index: Quake/gl_rmisc.c Index: Quake/gl_rmisc.c
=================================================================== ===================================================================
--- Quake/gl_rmisc.c (revision 508) --- Quake/gl_rmisc.c (revision 588)
+++ Quake/gl_rmisc.c (working copy) +++ Quake/gl_rmisc.c (working copy)
@@ -44,6 +44,7 @@ @@ -44,6 +44,7 @@
extern cvar_t r_lerpmove; extern cvar_t r_lerpmove;
@ -106,12 +107,12 @@ Index: Quake/gl_rmisc.c
extern cvar_t gl_zfix; // QuakeSpasm z-fighting fix extern cvar_t gl_zfix; // QuakeSpasm z-fighting fix
@@ -241,6 +242,7 @@ void R_Init (void) @@ -243,6 +244,7 @@ void R_Init (void)
Cvar_RegisterVariable (&r_lerpmove, NULL); Cvar_RegisterVariable (&r_nolerp_list);
Cvar_RegisterVariable (&r_nolerp_list, R_NoLerpList_f); Cvar_SetCallback (&r_nolerp_list, R_NoLerpList_f);
//johnfitz //johnfitz
+ Cvar_RegisterVariable (&r_externaltexture_fix, NULL); //mk + Cvar_RegisterVariable (&r_externaltexture_fix); //mk
Cvar_RegisterVariable (&gl_zfix, NULL); // QuakeSpasm z-fighting fix Cvar_RegisterVariable (&gl_zfix); // QuakeSpasm z-fighting fix