z-fighting (flickering gl texture clash most notable in e1m1) bug fix, from Sander.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@480 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
stevenaaus 2011-08-24 07:47:29 +00:00
parent 2713633423
commit 5a6a9c30d1
5 changed files with 22 additions and 3 deletions

View file

@ -103,6 +103,8 @@ cvar_t r_nolerp_list = {"r_nolerp_list", "progs/flame.mdl,progs/flame2.mdl,progs
extern cvar_t r_vfog;
//johnfitz
cvar_t gl_zfix = {"gl_zfix", "1", true}; // QuakeSpasm z-fighting fix
qboolean r_drawflat_cheatsafe, r_fullbright_cheatsafe, r_lightmap_cheatsafe, r_drawworld_cheatsafe; //johnfitz
/*

View file

@ -45,6 +45,8 @@ extern cvar_t r_lerpmove;
extern cvar_t r_nolerp_list;
//johnfitz
extern cvar_t gl_zfix; // QuakeSpasm z-fighting fix
extern float load_subdivide_size; //johnfitz -- remember what subdivide_size value was when this map was loaded
extern cvar_t gl_subdivide_size; //johnfitz -- moved here from gl_model.c
@ -240,6 +242,8 @@ void R_Init (void)
Cvar_RegisterVariable (&r_nolerp_list, R_NoLerpList_f);
//johnfitz
Cvar_RegisterVariable (&gl_zfix, NULL); // QuakeSpasm z-fighting fix
Cvar_RegisterVariable (&gl_subdivide_size, NULL); //johnfitz -- moved here from gl_model.c
R_InitParticles ();

View file

@ -73,6 +73,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define ON_EPSILON 0.1 // point on plane side epsilon
#define DIST_EPSILON (0.03125) // 1/32 epsilon to keep floating point happy (moved from world.c)
#define MAX_MSGLEN 32000 // max length of a reliable message //johnfitz -- was 8000
#define MAX_DATAGRAM 32000 // max length of unreliable message //johnfitz -- was 1024

View file

@ -25,6 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern cvar_t gl_fullbrights, r_drawflat, gl_overbright, r_oldwater; //johnfitz
extern cvar_t gl_zfix; // QuakeSpasm z-fighting fix
int gl_lightmap_format;
int lightmap_bytes;
@ -543,7 +545,19 @@ void R_DrawBrushModel (entity_t *e)
glPushMatrix ();
e->angles[0] = -e->angles[0]; // stupid quake bug
if (gl_zfix.value)
{
e->origin[0] -= DIST_EPSILON;
e->origin[1] -= DIST_EPSILON;
e->origin[2] -= DIST_EPSILON;
}
R_RotateForEntity (e->origin, e->angles);
if (gl_zfix.value)
{
e->origin[0] += DIST_EPSILON;
e->origin[1] += DIST_EPSILON;
e->origin[2] += DIST_EPSILON;
}
e->angles[0] = -e->angles[0]; // stupid quake bug
//

View file

@ -556,9 +556,6 @@ LINE TESTING IN HULLS
===============================================================================
*/
// 1/32 epsilon to keep floating point happy
#define DIST_EPSILON (0.03125)
/*
==================
SV_RecursiveHullCheck