Fix the black overbright dlights.

t was unsigned and underflowing. This fixes the problem but keeps the
bitshift unsigned clean.
This commit is contained in:
Bill Currie 2012-01-09 17:47:25 +09:00
parent 310ba49f17
commit 2b45cd693f

View file

@ -124,8 +124,8 @@ static void
R_BuildLightMap_1 (msurface_t *surf)
{
int smax, tmax, size;
unsigned scale, t;
int i;
unsigned scale;
int i, t;
byte *out;
smax = (surf->extents[0] >> 4) + 1;
@ -163,10 +163,10 @@ R_BuildLightMap_1 (msurface_t *surf)
// bound, invert, and shift
out = (byte *) blocklights;
for (i = 0; i < size; i++) {
t = (255 * 256 - (int) blocklights[i]) >> (8 - VID_CBITS);
t = max (t, 1 << 6);
*out++ = t >> 8;
t = (255 * 256 - (int) blocklights[i]);
t = max (t, 1 << (14 - VID_CBITS));
t = ((unsigned) t) >> (16 - VID_CBITS);
*out++ = t;
}
GL_SubpicUpdate (surf->lightpic, (byte *) blocklights);