Some optimizations, use memset instead of for loop with *bl++=0.

Uses almost 1% less CPU for me :-)
This commit is contained in:
Dabb 2001-02-20 16:52:24 +00:00
parent ea7e76fab7
commit 19c37bbcb3

View file

@ -235,22 +235,12 @@ R_BuildLightMap (msurface_t *surf, byte * dest, int stride)
// set to full bright if no light data
if (!cl.worldmodel->lightdata) {
bl = blocklights;
for (i = 0; i < size; i++) {
*bl++ = 255 << 8;
*bl++ = 255 << 8;
*bl++ = 255 << 8;
}
memset (&blocklights[0], 255, size * 3 * sizeof (unsigned int));
goto store;
}
// clear to no light
bl = blocklights;
for (i = 0; i < size; i++) {
*bl++ = 0;
*bl++ = 0;
*bl++ = 0;
}
bl = blocklights;
memset (&blocklights[0], 0, size * 3 * sizeof (unsigned int));
// add all the lightmaps
if (lightmap) {