Don't use MIN<short> when clamping topclip.

- This was fine with fixed point numbers, since they could never be
  outside of short range when converted to regular ints. With floating
  point numbers now, that condition no longer holds.
This commit is contained in:
Marisa Heit 2016-10-03 22:00:49 -05:00
parent d6346fb0c6
commit 594b344be9

View file

@ -2097,7 +2097,7 @@ void R_DrawSprite (vissprite_t *spr)
{ // seen below floor: clip top { // seen below floor: clip top
if (!spr->bIsVoxel && h > topclip) if (!spr->bIsVoxel && h > topclip)
{ {
topclip = MIN<short> (h, viewheight); topclip = short(MIN(h, viewheight));
} }
hzt = MIN(hzt, hz); hzt = MIN(hzt, hz);
} }
@ -2127,7 +2127,7 @@ void R_DrawSprite (vissprite_t *spr)
{ // seen in the middle: clip top { // seen in the middle: clip top
if (!spr->bIsVoxel && h > topclip) if (!spr->bIsVoxel && h > topclip)
{ {
topclip = MIN<short> (h, viewheight); topclip = MIN(h, viewheight);
} }
hzt = MIN(hzt, hz); hzt = MIN(hzt, hz);
} }
@ -2181,7 +2181,7 @@ void R_DrawSprite (vissprite_t *spr)
int h = xs_RoundToInt(CenterY - (hz - ViewPos.Z) * scale); int h = xs_RoundToInt(CenterY - (hz - ViewPos.Z) * scale);
if (h > topclip) if (h > topclip)
{ {
topclip = MIN<short>(h, viewheight); topclip = short(MIN(h, viewheight));
} }
} }
hzt = MIN(hzt, sclipTop); hzt = MIN(hzt, sclipTop);
@ -2204,7 +2204,7 @@ void R_DrawSprite (vissprite_t *spr)
h = (centeryfrac - FixedMul (h-viewz, scale)) >> FRACBITS; h = (centeryfrac - FixedMul (h-viewz, scale)) >> FRACBITS;
if (h > topclip) if (h > topclip)
{ {
topclip = MIN<short> (h, viewheight); topclip = short(MIN(h, viewheight));
} }
} }
#endif #endif