Convert r_clipsegment into a class

This commit is contained in:
Magnus Norddahl 2017-01-15 22:57:42 +01:00
commit f6cc75fad5
6 changed files with 33 additions and 23 deletions

View file

@ -91,7 +91,7 @@ namespace swrenderer
if (line->linedef == NULL)
{
if (R_CheckClipWallSegment(WallC.sx1, WallC.sx2))
if (RenderClipSegment::Instance()->Check(WallC.sx1, WallC.sx2))
{
InSubsector->flags |= SSECF_DRAWN;
}
@ -257,7 +257,7 @@ namespace swrenderer
// mark their subsectors as visible for automap texturing.
if (hasglnodes && !(InSubsector->flags & SSECF_DRAWN))
{
if (R_CheckClipWallSegment(WallC.sx1, WallC.sx2))
if (RenderClipSegment::Instance()->Check(WallC.sx1, WallC.sx2))
{
InSubsector->flags |= SSECF_DRAWN;
}
@ -298,7 +298,7 @@ namespace swrenderer
}
static SWRenderLine *self = this;
bool visible = R_ClipWallSegment(WallC.sx1, WallC.sx2, solid, [](int x1, int x2) -> bool
bool visible = RenderClipSegment::Instance()->Clip(WallC.sx1, WallC.sx2, solid, [](int x1, int x2) -> bool
{
return self->RenderWallSegment(x1, x2);
});