mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-10 14:42:13 +00:00
r_loadlit 2 will generate lux files even if the user has a lit (without overwriting the lit) - needs HLbsp testing.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@205 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
9c94742305
commit
e393b9ae3f
1 changed files with 9 additions and 4 deletions
|
@ -94,6 +94,7 @@ extern cvar_t gl_subdivide_water;
|
|||
#ifdef RUNTIMELIGHTING
|
||||
model_t *lightmodel;
|
||||
int numlightdata;
|
||||
qboolean writelitfile;
|
||||
|
||||
int relitsurface;
|
||||
void GLMod_UpdateLightmap(int snum)
|
||||
|
@ -424,9 +425,12 @@ void GLMod_Think (void)
|
|||
COM_DefaultExtension(filename, ".lux");
|
||||
COM_WriteFile(filename, lightmodel->deluxdata-8, numlightdata*3+8);
|
||||
|
||||
COM_StripExtension(lightmodel->name, filename);
|
||||
COM_DefaultExtension(filename, ".lit");
|
||||
COM_WriteFile(filename, lightmodel->lightdata-8, numlightdata*3+8);
|
||||
if (writelitfile) //the user might already have a lit file (don't overwrite it).
|
||||
{
|
||||
COM_StripExtension(lightmodel->name, filename);
|
||||
COM_DefaultExtension(filename, ".lit");
|
||||
COM_WriteFile(filename, lightmodel->lightdata-8, numlightdata*3+8);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -1318,11 +1322,12 @@ void GLMod_LoadLighting (lump_t *l)
|
|||
return;
|
||||
}
|
||||
#ifdef RUNTIMELIGHTING
|
||||
if (!loadmodel->rgblighting && r_loadlits.value == 2 && !lightmodel)
|
||||
if (r_loadlits.value == 2 && !lightmodel && (loadmodel->rgblighting != true || (!luxdata && gl_bumpmappingpossible)))
|
||||
{
|
||||
qbyte *litdata = NULL;
|
||||
int i;
|
||||
qbyte *normal;
|
||||
writelitfile = !loadmodel->rgblighting;
|
||||
loadmodel->rgblighting = true;
|
||||
loadmodel->lightdata = Hunk_AllocName ( l->filelen*3+8, loadname);
|
||||
strcpy(loadmodel->lightdata, "QLIT");
|
||||
|
|
Loading…
Reference in a new issue