1
0
Fork 0
forked from fte/fteqw

playing with lit file paths, so that qw/maps/2fort5.lit isn't a higher priority than fortress/lits/2fort5.lit

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@276 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2004-09-30 23:02:52 +00:00
parent db3aebb341
commit b81cfa6077

View file

@ -1269,22 +1269,33 @@ void GLMod_LoadLighting (lump_t *l)
if (r_loadlits.value)
{
qbyte *litdata = NULL;
char litname[MAX_QPATH];
if (!litdata)
char *litname;
char litnamemaps[MAX_QPATH];
char litnamelits[MAX_QPATH];
int depthmaps;
int depthlits;
{
strcpy(litname, loadmodel->name);
COM_StripExtension(loadmodel->name, litname);
COM_DefaultExtension(litname, ".lit");
litdata = COM_LoadHunkFile(litname);
strcpy(litnamemaps, loadmodel->name);
COM_StripExtension(loadmodel->name, litnamemaps);
COM_DefaultExtension(litnamemaps, ".lit");
depthmaps = COM_FDepthFile(litnamemaps, false);
}
if (!litdata)
{
strcpy(litname, "lits/");
COM_StripExtension(COM_SkipPath(loadmodel->name), litname+5);
strcat(litname, ".lit");
litdata = COM_LoadHunkFile(litname);
strcpy(litnamelits, "lits/");
COM_StripExtension(COM_SkipPath(loadmodel->name), litnamelits+5);
strcat(litnamelits, ".lit");
depthlits = COM_FDepthFile(litnamelits, false);
}
if (depthmaps <= depthlits)
litname = litnamemaps; //maps has priority over lits
else
{
litname = litnamelits;
}
litdata = COM_LoadHunkFile(litname);
COM_StripExtension(COM_SkipPath(loadmodel->name), litname+5);
strcat(litname, ".lit");
if (litdata && (litdata[0] == 'Q' && litdata[1] == 'L' && litdata[2] == 'I' && litdata[3] == 'T'))