Make the SURF_DRAWSKY fix committed in 325e893 optional.

The developers tested their maps without the fix and decided that it
looked good. Add a new cvar gl_fixsurfsky defaulting to 0 that enables
the fix if someone really want it.
This commit is contained in:
Yamagi Burmeister 2019-05-04 17:23:20 +02:00
parent 325e893376
commit 401ec04691
2 changed files with 14 additions and 4 deletions

View file

@ -577,6 +577,8 @@ Mod_LoadFaces(lump_t *l)
int planenum, side; int planenum, side;
int ti; int ti;
cvar_t* gl_fixsurfsky = ri.Cvar_Get("gl_fixsurfsky", "0", CVAR_ARCHIVE);
in = (void *)(mod_base + l->fileofs); in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in)) if (l->filelen % sizeof(*in))
@ -655,10 +657,13 @@ Mod_LoadFaces(lump_t *l)
R_SubdivideSurface(out); /* cut up polygon for warps */ R_SubdivideSurface(out); /* cut up polygon for warps */
} }
if (gl_fixsurfsky->value)
{
if (out->texinfo->flags & SURF_SKY) if (out->texinfo->flags & SURF_SKY)
{ {
out->flags |= SURF_DRAWSKY; out->flags |= SURF_DRAWSKY;
} }
}
/* create lightmaps and polygons */ /* create lightmaps and polygons */
if (!(out->texinfo->flags & (SURF_SKY | SURF_TRANS33 | SURF_TRANS66 | SURF_WARP))) if (!(out->texinfo->flags & (SURF_SKY | SURF_TRANS33 | SURF_TRANS66 | SURF_WARP)))

View file

@ -463,6 +463,8 @@ Mod_LoadFaces(lump_t *l)
int planenum, side; int planenum, side;
int ti; int ti;
cvar_t* gl_fixsurfsky = ri.Cvar_Get("gl_fixsurfsky", "0", CVAR_ARCHIVE);
in = (void *)(mod_base + l->fileofs); in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in)) if (l->filelen % sizeof(*in))
@ -541,10 +543,13 @@ Mod_LoadFaces(lump_t *l)
GL3_SubdivideSurface(out, loadmodel); /* cut up polygon for warps */ GL3_SubdivideSurface(out, loadmodel); /* cut up polygon for warps */
} }
if (gl_fixsurfsky->value)
{
if (out->texinfo->flags & SURF_SKY) if (out->texinfo->flags & SURF_SKY)
{ {
out->flags |= SURF_DRAWSKY; out->flags |= SURF_DRAWSKY;
} }
}
/* create lightmaps and polygons */ /* create lightmaps and polygons */
if (!(out->texinfo->flags & (SURF_SKY | SURF_TRANS33 | SURF_TRANS66 | SURF_WARP))) if (!(out->texinfo->flags & (SURF_SKY | SURF_TRANS33 | SURF_TRANS66 | SURF_WARP)))