From b0b048c703b9b10d957667d814bd65f1fa401c57 Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 10 Oct 2025 23:37:13 +0200 Subject: [PATCH] move "newview sky" check before skyplane loop saves us some pointless work going through all planes if we dont need to draw the sky --- src/r_plane.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/r_plane.cpp b/src/r_plane.cpp index 475e8a44d..de713dc9c 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -749,6 +749,13 @@ void R_DrawSkyPlanes(void) visplane_t *pl; INT32 i; + // If we're not supposed to draw the sky (e.g. for skyboxes), don't do anything! + // This probably utterly ruins sky rendering for FOFs and polyobjects, unfortunately + if (!newview->sky) + { + return; + } + #ifdef HAVE_THREADS srb2::ThreadPool::Sema tp_sema; srb2::g_main_threadpool->begin_sema(); @@ -777,13 +784,6 @@ static void R_DrawSkyPlane(visplane_t *pl, void(*colfunc2)(drawcolumndata_t*), b if (!(pl->minx <= pl->maxx)) return; - // If we're not supposed to draw the sky (e.g. for skyboxes), don't do anything! - // This probably utterly ruins sky rendering for FOFs and polyobjects, unfortunately - if (!newview->sky) - { - return; - } - drawcolumndata_t dc = {}; const INT32 texture = texturetranslation[skytexture];