*/
void WritePortalFile_r (node_t *node)
{
- int i, s;
+ int i, s, flags;
portal_t *p;
winding_t *w;
vec3_t normal;
}
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++)
{
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 */
*/
void LoadPortals (char *name)
{
- int i, j, hint;
+ int i, j, flags;
vportal_t *p;
leaf_t *l;
char magic[80];
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;
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;
*/
/* ydnar: this is known-to-be-working farplane code */
+ if( !p->sky && !tp->sky )
if( farPlaneDist > 0.0f )
{
VectorSubtract( p->origin, tp->origin, dir );