From 663be3adb1ded2ddcb81cdce32fe8a122405bcb1 Mon Sep 17 00:00:00 2001 From: timbergeron Date: Tue, 24 Sep 2024 14:46:06 -0700 Subject: [PATCH] enhance `r_fastsky 2` behavior to prioritize loading external sky textures --- Quake/gl_sky.c | 3 +++ Quake/r_world.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Quake/gl_sky.c b/Quake/gl_sky.c index c7dc992e..2f82822b 100644 --- a/Quake/gl_sky.c +++ b/Quake/gl_sky.c @@ -42,6 +42,7 @@ vec4_t skyroom_origin; vec4_t skyroom_orientation; char skybox_name[1024]; //name of current skybox, or "" if no skybox +qboolean externalskyloaded; // woods #fastsky2 gltexture_t *skybox_textures[6]; gltexture_t *solidskytexture, *alphaskytexture; @@ -266,6 +267,7 @@ qboolean Sky_LoadExternalTextures (qmodel_t* mod, texture_t* mt) if (malloced_back) free(back_data); if (malloced_front) free(front_data); Hunk_FreeToLowMark(mark); + externalskyloaded = true; // #fastsky2 return true; // success: both textures loaded } @@ -273,6 +275,7 @@ qboolean Sky_LoadExternalTextures (qmodel_t* mod, texture_t* mt) if (malloced_front) free(front_data); Hunk_FreeToLowMark(mark); + externalskyloaded = false; // #fastsky2 return false; } diff --git a/Quake/r_world.c b/Quake/r_world.c index 8136d483..5f45a31c 100644 --- a/Quake/r_world.c +++ b/Quake/r_world.c @@ -33,6 +33,7 @@ static void RSceneCache_Draw(qboolean water); void RSceneCache_Shutdown(void); extern qboolean lightmaps_skipupdates; extern char skybox_name[1024]; // woods -- #fastsky2 +extern qboolean externalskyloaded; // woods -- #fastsky2 //============================================================================== // @@ -2251,7 +2252,7 @@ static void RSceneCache_Draw(qboolean water) if (r_fastsky.value == 1) // woods -- #fastsky2 mode = 3; else if (r_fastsky.value == 2) - mode = skybox_name[0] ? 2 : 3; + mode = (skybox_name[0] || externalskyloaded) ? 2 : 3; else mode = 2;