Add some helpers on DrawSegmentClipInfo

This commit is contained in:
Magnus Norddahl 2019-11-13 04:17:46 +01:00
commit 88848f1d59
12 changed files with 122 additions and 75 deletions

View file

@ -168,6 +168,22 @@ namespace swrenderer
}
}
void ProjectedWallLine::ClipTop(int x1, int x2, const DrawSegmentClipInfo& clip)
{
for (int i = x1; i < x2; i++)
{
ScreenY[i] = std::max(ScreenY[i], clip.sprtopclip[i]);
}
}
void ProjectedWallLine::ClipBottom(int x1, int x2, const DrawSegmentClipInfo& clip)
{
for (int i = x1; i < x2; i++)
{
ScreenY[i] = std::min(ScreenY[i], clip.sprbottomclip[i]);
}
}
/////////////////////////////////////////////////////////////////////////
void FWallTmapVals::InitFromWallCoords(RenderThread* thread, const FWallCoords* wallc)