Skip to content

Commit

Permalink
enhance r_fastsky 2 behavior to prioritize loading external sky tex…
Browse files Browse the repository at this point in the history
…tures
  • Loading branch information
timbergeron committed Sep 24, 2024
1 parent ba312a3 commit 663be3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Quake/gl_sky.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -266,13 +267,15 @@ 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
}

if (malloced_back) free(back_data);
if (malloced_front) free(front_data);
Hunk_FreeToLowMark(mark);

externalskyloaded = false; // #fastsky2
return false;
}

Expand Down
3 changes: 2 additions & 1 deletion Quake/r_world.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

//==============================================================================
//
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 663be3a

Please sign in to comment.