// lighting.c #include "light.h" /* NOTES ----- */ float scaledist = 1.0; float scalecos = 0.5; float rangescale = 0.5; byte *filebase, *file_p, *file_end; dmodel_t *bspmodel; int bspfileface; // next surface to dispatch vec3_t bsp_origin; qboolean extrasamples; float minlights[MAX_MAP_FACES]; byte *GetFileSpace (int size) { byte *buf; LOCK; file_p = (byte *)(((long)file_p + 3)&~3); buf = file_p; file_p += size; UNLOCK; if (file_p > file_end) Error ("GetFileSpace: overrun"); return buf; } void LightThread (void *junk) { int i; while (1) { LOCK; i = bspfileface++; UNLOCK; if (i >= numfaces) return; LightFace (i); } } /* ============= LightWorld ============= */ void LightWorld (void) { filebase = file_p = dlightdata; file_end = filebase + MAX_MAP_LIGHTING; RunThreadsOn (LightThread); lightdatasize = file_p - filebase; printf ("lightdatasize: %i\n", lightdatasize); } /* ======== main light modelfile ======== */ int main (int argc, char **argv) { int i; double start, end; char source[1024]; printf ("----- LightFaces ----\n"); for (i=1 ; i