From 83de4399fd348a171a57bf3cf3ec42435fd8da59 Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 28 Oct 2024 20:24:46 +0100 Subject: [PATCH] fix portal culling --- src/hardware/hw_main.c | 4 +++- src/hardware/hw_portal.c | 1 - src/hardware/hw_portal.h | 6 ------ 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 764caf28f..8d4c72a7d 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -5091,10 +5091,12 @@ void HWR_SetStencilState(int state, int level) // Renders the current viewpoint, though takes portal arguments for recursive portals. void HWR_RenderViewpoint(gl_portal_t *rootportal, const float fpov, player_t *player, int stencil_level, boolean allow_portals) { + gl_portallist_t portallist; + const boolean skybox = (skyboxmo[0] && cv_skybox.value); const boolean useportals = cv_glportals.value && gl_maphasportals && allow_portals; - HWR_Portal_InitList(); + portallist.base = portallist.cap = NULL; if (useportals && stencil_level < cv_maxportals.value) // if recursion limit is not reached { diff --git a/src/hardware/hw_portal.c b/src/hardware/hw_portal.c index 6c114df07..9cfc0a293 100644 --- a/src/hardware/hw_portal.c +++ b/src/hardware/hw_portal.c @@ -30,7 +30,6 @@ SINT8 gl_portal_state = GLPORTAL_OFF; -gl_portallist_t portallist; gl_portallist_t *currentportallist; // Adds an entry to the clipper for portal rendering diff --git a/src/hardware/hw_portal.h b/src/hardware/hw_portal.h index 9b2349955..b3ca3bb6e 100644 --- a/src/hardware/hw_portal.h +++ b/src/hardware/hw_portal.h @@ -58,14 +58,8 @@ typedef struct gl_portallist_s extern SINT8 gl_portal_state; // new thing -extern gl_portallist_t portallist; extern gl_portallist_t *currentportallist; -static inline void HWR_Portal_InitList (void) -{ - portallist.base = portallist.cap = NULL; -} - static inline void HWR_SetPortalState (SINT8 state) { gl_portal_state = state;