diff --git a/src/hardware/hw_main.cpp b/src/hardware/hw_main.cpp index ce1ab6667..b53b7cb82 100644 --- a/src/hardware/hw_main.cpp +++ b/src/hardware/hw_main.cpp @@ -5456,10 +5456,14 @@ void HWR_RenderViewpoint(gl_portal_t *rootportal, player_t *player, int stencil_ currentportallist = &portallist; HWR_SetPortalState(GLPORTAL_SEARCH); - HWR_ClearClipper(); + HWR_SetTransform(fpov); + HWR_ClearSprites(); + HWR_ClearClipper(); if (rootportal) + { HWR_PortalClipping(rootportal); + } validcount++; @@ -5477,14 +5481,14 @@ void HWR_RenderViewpoint(gl_portal_t *rootportal, player_t *player, int stencil_ } } - // draw normal things in current frame in current incremented stencil buffer area - HWR_SetStencilState(HWR_STENCIL_NORMAL, stencil_level); - HWR_SetTransform(fpov); HWR_ClearSprites(); HWR_ClearClipper(); + // draw normal things in current frame in current incremented stencil buffer area + HWR_SetStencilState(HWR_STENCIL_NORMAL, stencil_level); + if constexpr (Type == RenderViewpointType::kPortal) { if (allow_portals && rootportal) diff --git a/src/hardware/hw_portal.c b/src/hardware/hw_portal.c index d8ad87354..952bd0e66 100644 --- a/src/hardware/hw_portal.c +++ b/src/hardware/hw_portal.c @@ -38,7 +38,7 @@ void HWR_PortalClipping(gl_portal_t *portal) gld_clipper_SafeAddClipRange(portal->angle1, portal->angle2); } -static gl_portal_t* HWR_Portal_Add (seg_t *seg) +static gl_portal_t* HWR_Portal_Add(seg_t *seg) { gl_portal_t *portal = Z_Malloc(sizeof(gl_portal_t), PU_STATIC, NULL); @@ -120,8 +120,8 @@ void HWR_PortalFrame(gl_portal_t* portal) viewz = portal->viewz; viewangle = portal->viewangle; - //viewsin = FINESINE(viewangle>>ANGLETOFINESHIFT); - //viewcos = FINECOSINE(viewangle>>ANGLETOFINESHIFT); + viewsin = FINESINE(viewangle>>ANGLETOFINESHIFT); + viewcos = FINECOSINE(viewangle>>ANGLETOFINESHIFT); if (portal->clipline != -1) {