Back out Chris Ison's patch, make another change for readability (in this

case, 255 << 8 is more readable than 255*256, and was the intent anyway)
This commit is contained in:
Jeff Teunissen 2000-09-26 16:15:57 +00:00
parent 50abe6080e
commit cbc9d34954

View file

@ -254,15 +254,23 @@ R_BuildLightMap (msurface_t *surf, byte *dest, int stride)
if (!cl.worldmodel->lightdata) {
bl = blocklights;
for (i=0 ; i<size ; i++) {
*bl++ = 255*256;
*bl++ = 255*256;
*bl++ = 255*256;
*bl++ = 255 << 8;
*bl++ = 255 << 8;
*bl++ = 255 << 8;
}
goto store;
}
// add all the lightmaps
// clear to no light
bl = blocklights;
for (i=0; i < size; i++) {
*bl++ = 0;
*bl++ = 0;
*bl++ = 0;
}
bl = blocklights;
// add all the lightmaps
if (lightmap) {
for (maps = 0;
maps < MAXLIGHTMAPS && surf->styles[maps] != 255;
@ -271,17 +279,11 @@ R_BuildLightMap (msurface_t *surf, byte *dest, int stride)
surf->cached_light[maps] = scale; // 8.8 fraction
bl = blocklights;
for (i = 0; i < size; i++) {
*bl++ = *lightmap++ * scale;
*bl++ = *lightmap++ * scale;
*bl++ = *lightmap++ * scale;
*bl++ += *lightmap++ * scale;
*bl++ += *lightmap++ * scale;
*bl++ += *lightmap++ * scale;
}
}
} else {
for (i = 0; i < size; i++) {
*bl++ = 0;
*bl++ = 0;
*bl++ = 0;
}
}
// add all the dynamic lights