mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-22 04:21:23 +00:00
Negative Light
Light no longer goes wrong when lightlevel of a sector is negative.
This commit is contained in:
parent
770c7eeade
commit
9e10e3278b
1 changed files with 12 additions and 0 deletions
|
@ -401,6 +401,12 @@ UINT32 HWR_Lighting(INT32 light, UINT32 color, UINT32 fadecolor, boolean fogbloc
|
|||
|
||||
(void)fogblockpoly;
|
||||
|
||||
// Don't go out of bounds
|
||||
if (light < 0)
|
||||
light = 0;
|
||||
else if (light > 255)
|
||||
light = 255;
|
||||
|
||||
realcolor.rgba = color;
|
||||
fogcolor.rgba = fadecolor;
|
||||
|
||||
|
@ -488,6 +494,12 @@ static UINT8 HWR_FogBlockAlpha(INT32 light, UINT32 color, UINT32 fadecolor) // L
|
|||
RGBA_t realcolor, fogcolor, surfcolor;
|
||||
INT32 alpha, fogalpha;
|
||||
|
||||
// Don't go out of bounds
|
||||
if (light < 0)
|
||||
light = 0;
|
||||
else if (light > 255)
|
||||
light = 255;
|
||||
|
||||
realcolor.rgba = color;
|
||||
fogcolor.rgba = fadecolor;
|
||||
|
||||
|
|
Loading…
Reference in a new issue