From c009866158652705b78def2cb87b154a04dec3fa Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 28 Oct 2024 17:29:01 +0100 Subject: [PATCH] Revert "dont pass skybox to r_setupframe" This reverts commit 78c0f64135d66ed10f3185ed4cd9b9fb17878960. --- src/hardware/hw_main.c | 2 +- src/hardware/hw_portal.c | 2 +- src/p_tick.c | 7 ++++--- src/r_main.c | 6 +++--- src/r_main.h | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 20e4a069d..8875290b7 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -5315,7 +5315,7 @@ void HWR_RenderPlayerView(INT32 viewnumber, player_t *player) } PS_STOP_TIMING(ps_skyboxtime); - R_SetupFrame(viewssnum); // This can stay false because it is only used to set viewsky in r_main.c, which isn't used here + R_SetupFrame(viewssnum, false); // This can stay false because it is only used to set viewsky in r_main.c, which isn't used here framecount++; // for timedemo HWR_RenderFrame(viewnumber, player, false); } diff --git a/src/hardware/hw_portal.c b/src/hardware/hw_portal.c index 48f6ee983..6c114df07 100644 --- a/src/hardware/hw_portal.c +++ b/src/hardware/hw_portal.c @@ -181,7 +181,7 @@ void HWR_RenderPortal(gl_portal_t* portal, gl_portal_t* rootportal, const float HWR_PortalFrame(rootportal); else // current frame is not a portal frame but the main view! { - R_SetupFrame(viewssnum); + R_SetupFrame(viewssnum, false); portalclipline = NULL; } diff --git a/src/p_tick.c b/src/p_tick.c index 40bec5079..fd5851cb4 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -694,13 +694,14 @@ void P_Ticker(boolean run) if (!player->mo) continue; - const boolean skybox = (skyVisiblePerPlayer[i] && skyboxmo[0] && cv_skybox.value); + const boolean skybox = (skyboxmo[0] && cv_skybox.value); + boolean isSkyVisibleForPlayer = skyVisiblePerPlayer[i]; - if (skybox) + if (isSkyVisibleForPlayer && skybox) { R_SkyboxFrame(i); } - R_SetupFrame(i); + R_SetupFrame(i, skybox); } } } diff --git a/src/r_main.c b/src/r_main.c index 41839bb92..e1080f949 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -1221,7 +1221,7 @@ void R_SkyboxFrame(int s) R_SetupCommonFrame(player, viewmobj->subsector); } -void R_SetupFrame(int s) +void R_SetupFrame(int s, boolean skybox) { player_t *player = &players[displayplayers[s]]; camera_t *thiscam = &camera[s]; @@ -1247,7 +1247,7 @@ void R_SetupFrame(int s) else if (thiscam && !chasecam) thiscam->chase = false; - newview->sky = false; + newview->sky = !skybox; R_SetupAimingFrame(player, thiscam); @@ -1385,7 +1385,7 @@ void R_RenderPlayerView(player_t *player) } PS_STOP_TIMING(ps_skyboxtime); - R_SetupFrame(viewssnum); + R_SetupFrame(viewssnum, skybox); skyVisible = false; framecount++; validcount++; diff --git a/src/r_main.h b/src/r_main.h index ab330c51f..55c00b511 100644 --- a/src/r_main.h +++ b/src/r_main.h @@ -223,7 +223,7 @@ void R_SetViewSize(void); void R_ExecuteSetViewSize(void); void R_SkyboxFrame(int s); -void R_SetupFrame(int s); +void R_SetupFrame(int s, boolean skybox); // Called by G_Drawer. void R_RenderPlayerView(player_t *player);