_farplanedist now ignores C_SKY leafs
This commit is contained in:
parent
6b01d68ba6
commit
34d45e210f
|
|
@ -102,7 +102,7 @@ WritePortalFile_r
|
|||
*/
|
||||
void WritePortalFile_r (node_t *node)
|
||||
{
|
||||
int i, s;
|
||||
int i, s, flags;
|
||||
portal_t *p;
|
||||
winding_t *w;
|
||||
vec3_t normal;
|
||||
|
|
@ -144,12 +144,18 @@ void WritePortalFile_r (node_t *node)
|
|||
}
|
||||
else
|
||||
fprintf (pf,"%i %i %i ",w->numpoints, p->nodes[0]->cluster, p->nodes[1]->cluster);
|
||||
|
||||
flags = 0;
|
||||
|
||||
/* ydnar: added this change to make antiportals work */
|
||||
if( p->compileFlags & C_HINT )
|
||||
fprintf( pf, "1 " );
|
||||
else
|
||||
fprintf( pf, "0 " );
|
||||
flags |= 1;
|
||||
|
||||
/* divVerent: I want farplanedist to not kill skybox. So... */
|
||||
if( p->compileFlags & C_SKY )
|
||||
flags |= 2;
|
||||
|
||||
fprintf( pf, "%d ", flags );
|
||||
|
||||
/* write the winding */
|
||||
for (i=0 ; i<w->numpoints ; i++)
|
||||
|
|
|
|||
|
|
@ -1236,6 +1236,7 @@ typedef struct
|
|||
{
|
||||
int num;
|
||||
qboolean hint; /* true if this portal was created from a hint splitter */
|
||||
qboolean sky; /* true if this portal belongs to a sky leaf */
|
||||
qboolean removed;
|
||||
visPlane_t plane; /* normal pointing into neighbor */
|
||||
int leaf; /* neighbor */
|
||||
|
|
|
|||
|
|
@ -870,7 +870,7 @@ LoadPortals
|
|||
*/
|
||||
void LoadPortals (char *name)
|
||||
{
|
||||
int i, j, hint;
|
||||
int i, j, flags;
|
||||
vportal_t *p;
|
||||
leaf_t *l;
|
||||
char magic[80];
|
||||
|
|
@ -935,8 +935,8 @@ void LoadPortals (char *name)
|
|||
if (leafnums[0] > portalclusters
|
||||
|| leafnums[1] > portalclusters)
|
||||
Error ("LoadPortals: reading portal %i", i);
|
||||
if (fscanf (f, "%i ", &hint) != 1)
|
||||
Error ("LoadPortals: reading hint state");
|
||||
if (fscanf (f, "%i ", &flags) != 1)
|
||||
Error ("LoadPortals: reading flags");
|
||||
|
||||
w = p->winding = NewFixedWinding (numpoints);
|
||||
w->numpoints = numpoints;
|
||||
|
|
@ -970,7 +970,8 @@ void LoadPortals (char *name)
|
|||
l->numportals++;
|
||||
|
||||
p->num = i+1;
|
||||
p->hint = hint;
|
||||
p->hint = ((flags & 1) != 0);
|
||||
p->sky = ((flags & 2) != 0);
|
||||
p->winding = w;
|
||||
VectorSubtract (vec3_origin, plane.normal, p->plane.normal);
|
||||
p->plane.dist = -plane.dist;
|
||||
|
|
|
|||
|
|
@ -1583,6 +1583,7 @@ void BasePortalVis( int portalnum )
|
|||
*/
|
||||
|
||||
/* ydnar: this is known-to-be-working farplane code */
|
||||
if( !p->sky && !tp->sky )
|
||||
if( farPlaneDist > 0.0f )
|
||||
{
|
||||
VectorSubtract( p->origin, tp->origin, dir );
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user