Proper fix for Yavin sky

This commit is contained in:
Simon 2022-11-25 19:06:25 +00:00
parent b942a64fc2
commit 96b8b4ebd5
5 changed files with 7 additions and 1 deletions

View file

@ -92,6 +92,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
extern int skyboxportal;
extern int drawskyboxportal;
extern int hasskybox;
typedef byte color4ub_t[4];

View file

@ -495,7 +495,8 @@ static void RB_BeginDrawingView (void) {
}
else
{
if ( !( backEnd.refdef.rdflags & RDF_NOWORLDMODEL ) && !g_bRenderGlowingObjects )
if ((!hasskybox || r_fastsky->integer) &&
!( backEnd.refdef.rdflags & RDF_NOWORLDMODEL ) && !g_bRenderGlowingObjects )
{
if (tr.world && tr.world->globalFog != -1)
{

View file

@ -1342,6 +1342,7 @@ void RE_LoadWorldMap_Actual( const char *name, world_t &worldData, int index ) {
if (!index)
{
skyboxportal = 0;
hasskybox = 0;
tr.sunDirection[0] = 0.45f;
tr.sunDirection[1] = 0.3f;

View file

@ -42,6 +42,7 @@ int r_numpolyverts;
int skyboxportal;
int drawskyboxportal;
int hasskybox; // Used to indicate whether the BSP contains a skybox (if not, then use fog colour if applicable)
/*
====================

View file

@ -845,6 +845,8 @@ void RB_StageIteratorSky( void ) {
return;
}
hasskybox = 1;
// go through all the polygons and project them onto
// the sky box to see which blocks on each side need
// to be drawn