mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-17 01:11:45 +00:00
Split out the surface offset code.
This tidies up LightWorld a little.
This commit is contained in:
parent
48809404b1
commit
5fc8d1eb26
1 changed files with 13 additions and 7 deletions
|
@ -134,17 +134,13 @@ LightThread (void *l)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
LightWorld (void)
|
FindFaceOffsets (void)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
vec3_t org;
|
|
||||||
entity_t *ent;
|
entity_t *ent;
|
||||||
|
vec3_t org;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
lightdata = dstring_new ();
|
|
||||||
rgblightdata = dstring_new ();
|
|
||||||
surfacelightchain = (lightchain_t **) calloc (bsp->numfaces,
|
|
||||||
sizeof (lightchain_t *));
|
|
||||||
surfaceorgs = (vec3_t *) calloc (bsp->numfaces, sizeof (vec3_t));
|
surfaceorgs = (vec3_t *) calloc (bsp->numfaces, sizeof (vec3_t));
|
||||||
|
|
||||||
for (i = 1; i < bsp->nummodels; i++) {
|
for (i = 1; i < bsp->nummodels; i++) {
|
||||||
|
@ -156,8 +152,17 @@ LightWorld (void)
|
||||||
if (!strncmp (ValueForKey (ent, "classname"), "rotate_", 7))
|
if (!strncmp (ValueForKey (ent, "classname"), "rotate_", 7))
|
||||||
GetVectorForKey (ent, "origin", org);
|
GetVectorForKey (ent, "origin", org);
|
||||||
for (j = 0; j < bsp->models[i].numfaces; j++)
|
for (j = 0; j < bsp->models[i].numfaces; j++)
|
||||||
VectorCopy (org, surfaceorgs[i]);
|
VectorCopy (org, surfaceorgs[bsp->models[i].firstface]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
LightWorld (void)
|
||||||
|
{
|
||||||
|
lightdata = dstring_new ();
|
||||||
|
rgblightdata = dstring_new ();
|
||||||
|
surfacelightchain = (lightchain_t **) calloc (bsp->numfaces,
|
||||||
|
sizeof (lightchain_t *));
|
||||||
|
|
||||||
VisThread (0); // not worth threading :/
|
VisThread (0); // not worth threading :/
|
||||||
VisStats ();
|
VisStats ();
|
||||||
|
@ -205,6 +210,7 @@ main (int argc, char **argv)
|
||||||
|
|
||||||
MakeTnodes (&bsp->models[0]);
|
MakeTnodes (&bsp->models[0]);
|
||||||
|
|
||||||
|
FindFaceOffsets ();
|
||||||
LightWorld ();
|
LightWorld ();
|
||||||
|
|
||||||
WriteEntitiesToString ();
|
WriteEntitiesToString ();
|
||||||
|
|
Loading…
Reference in a new issue