From b47f5ab2352a875e34b50bee67d083159359a543 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 15 Aug 2024 15:19:11 +0200 Subject: [PATCH] move this in hw_main --- src/hardware/hw_cache.c | 1 - src/hardware/hw_main.c | 12 +++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/hardware/hw_cache.c b/src/hardware/hw_cache.c index 852a173be..9f02007d4 100644 --- a/src/hardware/hw_cache.c +++ b/src/hardware/hw_cache.c @@ -573,7 +573,6 @@ GLMapTexture_t *HWR_GetTexture(INT32 tex, boolean noencore) // If hardware does not have the texture, then call pfnSetTexture to upload it if (!grtex->mipmap.downloaded) HWD.pfnSetTexture(&grtex->mipmap); - HWR_SetCurrentTexture(&grtex->mipmap); // The system-memory data can be purged now. diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 810c0edd8..5ea10fda9 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -5523,16 +5523,14 @@ static void HWR_RenderViewpoint(gl_portal_t *rootportal, const float fpov, playe HWD.pfnSetTransform(&atransform); validcount++; - - if (cv_grbatching.value) - HWR_StartBatching(); - - HWR_AddPrecipitationSprites(); ps_numbspcalls.value.i = 0; ps_numpolyobjects.value.i = 0; PS_START_TIMING(ps_bsptime); + if (cv_grbatching.value) + HWR_StartBatching(); + if (!rootportal && portallist.base && !skybox)// if portals have been drawn in the main view, then render skywalls differently gr_collect_skywalls = true; @@ -5542,11 +5540,15 @@ static void HWR_RenderViewpoint(gl_portal_t *rootportal, const float fpov, playe if (gr_portal != GRPORTAL_OFF) // if we already haven't hit the recursion limit or we already ended our portal shenanigans gr_portal = GRPORTAL_INSIDE; // TURN IT OFF + // Recursively "render" the BSP tree. HWR_RenderBSPNode((INT32)numnodes-1); + // woo we back gr_portal = oldgl_portal_state; + HWR_AddPrecipitationSprites(); + PS_STOP_TIMING(ps_bsptime); if (cv_grbatching.value)