From 401ec04691ead017f5a1c27fcd8ade1fb8f094af Mon Sep 17 00:00:00 2001 From: Yamagi Burmeister Date: Sat, 4 May 2019 17:23:20 +0200 Subject: [PATCH] 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. --- src/client/refresh/gl1/gl1_model.c | 9 +++++++-- src/client/refresh/gl3/gl3_model.c | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/client/refresh/gl1/gl1_model.c b/src/client/refresh/gl1/gl1_model.c index 0af3fe76..c92031f9 100644 --- a/src/client/refresh/gl1/gl1_model.c +++ b/src/client/refresh/gl1/gl1_model.c @@ -577,6 +577,8 @@ Mod_LoadFaces(lump_t *l) int planenum, side; int ti; + cvar_t* gl_fixsurfsky = ri.Cvar_Get("gl_fixsurfsky", "0", CVAR_ARCHIVE); + in = (void *)(mod_base + l->fileofs); if (l->filelen % sizeof(*in)) @@ -655,9 +657,12 @@ Mod_LoadFaces(lump_t *l) R_SubdivideSurface(out); /* cut up polygon for warps */ } - if (out->texinfo->flags & SURF_SKY) + if (gl_fixsurfsky->value) { - out->flags |= SURF_DRAWSKY; + if (out->texinfo->flags & SURF_SKY) + { + out->flags |= SURF_DRAWSKY; + } } /* create lightmaps and polygons */ diff --git a/src/client/refresh/gl3/gl3_model.c b/src/client/refresh/gl3/gl3_model.c index 535325d4..6964e50c 100644 --- a/src/client/refresh/gl3/gl3_model.c +++ b/src/client/refresh/gl3/gl3_model.c @@ -463,6 +463,8 @@ Mod_LoadFaces(lump_t *l) int planenum, side; int ti; + cvar_t* gl_fixsurfsky = ri.Cvar_Get("gl_fixsurfsky", "0", CVAR_ARCHIVE); + in = (void *)(mod_base + l->fileofs); if (l->filelen % sizeof(*in)) @@ -541,9 +543,12 @@ Mod_LoadFaces(lump_t *l) GL3_SubdivideSurface(out, loadmodel); /* cut up polygon for warps */ } - if (out->texinfo->flags & SURF_SKY) + if (gl_fixsurfsky->value) { - out->flags |= SURF_DRAWSKY; + if (out->texinfo->flags & SURF_SKY) + { + out->flags |= SURF_DRAWSKY; + } } /* create lightmaps and polygons */