Tiny speedup.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@668 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2004-12-21 04:34:58 +00:00
parent 26a1533f97
commit 5baf239a6d

View file

@ -881,15 +881,27 @@ void GLR_BuildLightMap (msurface_t *surf, qbyte *dest, qbyte *deluxdest, stmap *
surf->cached_light[maps] = scale; // 8.8 fraction
surf->cached_colour[maps] = cl_lightstyle[surf->styles[maps]].colour;
if (cl_lightstyle[surf->styles[maps]].colour & 1)
if (cl_lightstyle[surf->styles[maps]].colour == 7) //hopefully a faster alternative.
{
for (i=0 ; i<size ; i++)
blocklights[i] += lightmap[i] * scale;
if (cl_lightstyle[surf->styles[maps]].colour & 2)
for (i=0 ; i<size ; i++)
greenblklights[i] += lightmap[i] * scale;
if (cl_lightstyle[surf->styles[maps]].colour & 4)
for (i=0 ; i<size ; i++)
blueblklights[i] += lightmap[i] * scale;
{
blocklights[i] += lightmap[i] * scale;
greenblklights[i] += lightmap[i] * scale;
blueblklights[i] += lightmap[i] * scale;
}
}
else
{
if (cl_lightstyle[surf->styles[maps]].colour & 1)
for (i=0 ; i<size ; i++)
blocklights[i] += lightmap[i] * scale;
if (cl_lightstyle[surf->styles[maps]].colour & 2)
for (i=0 ; i<size ; i++)
greenblklights[i] += lightmap[i] * scale;
if (cl_lightstyle[surf->styles[maps]].colour & 4)
for (i=0 ; i<size ; i++)
blueblklights[i] += lightmap[i] * scale;
}
lightmap += size; // skip to next lightmap
}
}