diff --git a/src/swrenderer/scene/r_portal.cpp b/src/swrenderer/scene/r_portal.cpp index 4d8c04ac41..6c585d13a4 100644 --- a/src/swrenderer/scene/r_portal.cpp +++ b/src/swrenderer/scene/r_portal.cpp @@ -527,8 +527,8 @@ namespace swrenderer void RenderPortal::SetMainPortal() { - WindowLeft = 0; - WindowRight = viewwidth; + WindowLeft = Thread->X1; + WindowRight = Thread->X2; MirrorFlags = 0; CurrentPortal = nullptr; CurrentPortalUniq = 0; diff --git a/src/swrenderer/things/r_visiblesprite.cpp b/src/swrenderer/things/r_visiblesprite.cpp index 8fb1876740..e9ddec275b 100644 --- a/src/swrenderer/things/r_visiblesprite.cpp +++ b/src/swrenderer/things/r_visiblesprite.cpp @@ -84,10 +84,6 @@ namespace swrenderer if (x1 >= x2) return; - // Reject sprites outside the slice rendered by the thread - if (x2 < thread->X1 || x1 > thread->X2) - return; - // [RH] Sprites split behind a one-sided line can also be discarded. if (spr->sector == nullptr) return; diff --git a/src/swrenderer/things/r_voxel.cpp b/src/swrenderer/things/r_voxel.cpp index fe626dd2fb..a11846abee 100644 --- a/src/swrenderer/things/r_voxel.cpp +++ b/src/swrenderer/things/r_voxel.cpp @@ -457,10 +457,7 @@ namespace swrenderer if (voxptr >= voxend) continue; lx = xs_RoundToInt(nx * centerxwide_f / (ny + y1)) + viewport->viewwindow.centerx; - if (lx < 0) lx = 0; rx = xs_RoundToInt((nx + nxoff) * centerxwide_f / (ny + y2)) + viewport->viewwindow.centerx; - if (rx > viewwidth) rx = viewwidth; - if (rx <= lx) continue; if (flags & DVF_MIRRORED) { @@ -469,6 +466,10 @@ namespace swrenderer rx = t; } + if (lx < this->x1) lx = this->x1; + if (rx > this->x2) rx = this->x2; + if (rx <= lx) continue; + fixed_t l1 = xs_RoundToInt(centerxwidebig_f / (ny - yoff)); fixed_t l2 = xs_RoundToInt(centerxwidebig_f / (ny + yoff)); for (; voxptr < voxend; voxptr = (kvxslab_t *)((uint8_t *)voxptr + voxptr->zleng + 3))