mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-27 06:34:11 +00:00
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:
parent
310ba49f17
commit
2b45cd693f
1 changed files with 6 additions and 6 deletions
|
@ -124,8 +124,8 @@ static void
|
||||||
R_BuildLightMap_1 (msurface_t *surf)
|
R_BuildLightMap_1 (msurface_t *surf)
|
||||||
{
|
{
|
||||||
int smax, tmax, size;
|
int smax, tmax, size;
|
||||||
unsigned scale, t;
|
unsigned scale;
|
||||||
int i;
|
int i, t;
|
||||||
byte *out;
|
byte *out;
|
||||||
|
|
||||||
smax = (surf->extents[0] >> 4) + 1;
|
smax = (surf->extents[0] >> 4) + 1;
|
||||||
|
@ -163,10 +163,10 @@ R_BuildLightMap_1 (msurface_t *surf)
|
||||||
// bound, invert, and shift
|
// bound, invert, and shift
|
||||||
out = (byte *) blocklights;
|
out = (byte *) blocklights;
|
||||||
for (i = 0; i < size; i++) {
|
for (i = 0; i < size; i++) {
|
||||||
t = (255 * 256 - (int) blocklights[i]) >> (8 - VID_CBITS);
|
t = (255 * 256 - (int) blocklights[i]);
|
||||||
|
t = max (t, 1 << (14 - VID_CBITS));
|
||||||
t = max (t, 1 << 6);
|
t = ((unsigned) t) >> (16 - VID_CBITS);
|
||||||
*out++ = t >> 8;
|
*out++ = t;
|
||||||
}
|
}
|
||||||
|
|
||||||
GL_SubpicUpdate (surf->lightpic, (byte *) blocklights);
|
GL_SubpicUpdate (surf->lightpic, (byte *) blocklights);
|
||||||
|
|
Loading…
Reference in a new issue