mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 13:01:47 +00:00
- fixed crash in slope drawing: Several overlooked occurences of fixed point math in R_CalcTiltedLighting. Slopes are still completely broken, though.
This commit is contained in:
parent
a26d81e060
commit
8bda356412
1 changed files with 7 additions and 7 deletions
|
@ -287,21 +287,21 @@ void R_CalcTiltedLighting (double lval, double lend, int width)
|
||||||
}
|
}
|
||||||
if (width > 0)
|
if (width > 0)
|
||||||
{
|
{
|
||||||
lval = planeshade - lval;
|
lval = FIXED2DBL(planeshade) - lval;
|
||||||
lend = planeshade - lend;
|
lend = FIXED2DBL(planeshade) - lend;
|
||||||
lstep = (lend - lval) / width;
|
lstep = (lend - lval) / width;
|
||||||
if (lstep < 0)
|
if (lstep < 0)
|
||||||
{ // Going from dark to light
|
{ // Going from dark to light
|
||||||
if (lval < FRACUNIT)
|
if (lval < 1.)
|
||||||
{ // All bright
|
{ // All bright
|
||||||
lightfiller = basecolormapdata;
|
lightfiller = basecolormapdata;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (lval >= NUMCOLORMAPS*FRACUNIT)
|
if (lval >= NUMCOLORMAPS)
|
||||||
{ // Starts beyond the dark end
|
{ // Starts beyond the dark end
|
||||||
BYTE *clight = basecolormapdata + ((NUMCOLORMAPS-1) << COLORMAPSHIFT);
|
BYTE *clight = basecolormapdata + ((NUMCOLORMAPS-1) << COLORMAPSHIFT);
|
||||||
while (lval >= NUMCOLORMAPS*FRACUNIT && i <= width)
|
while (lval >= NUMCOLORMAPS && i <= width)
|
||||||
{
|
{
|
||||||
tiltlighting[i++] = clight;
|
tiltlighting[i++] = clight;
|
||||||
lval += lstep;
|
lval += lstep;
|
||||||
|
@ -319,7 +319,7 @@ void R_CalcTiltedLighting (double lval, double lend, int width)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Going from light to dark
|
{ // Going from light to dark
|
||||||
if (lval >= (NUMCOLORMAPS-1)*FRACUNIT)
|
if (lval >= (NUMCOLORMAPS-1))
|
||||||
{ // All dark
|
{ // All dark
|
||||||
lightfiller = basecolormapdata + ((NUMCOLORMAPS-1) << COLORMAPSHIFT);
|
lightfiller = basecolormapdata + ((NUMCOLORMAPS-1) << COLORMAPSHIFT);
|
||||||
}
|
}
|
||||||
|
@ -332,7 +332,7 @@ void R_CalcTiltedLighting (double lval, double lend, int width)
|
||||||
}
|
}
|
||||||
if (i > width)
|
if (i > width)
|
||||||
return;
|
return;
|
||||||
while (i <= width && lval < (NUMCOLORMAPS-1)*FRACUNIT)
|
while (i <= width && lval < (NUMCOLORMAPS-1))
|
||||||
{
|
{
|
||||||
tiltlighting[i++] = basecolormapdata + (xs_ToInt(lval) << COLORMAPSHIFT);
|
tiltlighting[i++] = basecolormapdata + (xs_ToInt(lval) << COLORMAPSHIFT);
|
||||||
lval += lstep;
|
lval += lstep;
|
||||||
|
|
Loading…
Reference in a new issue