hack for skies and spectating from above.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4826 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
b7a4b8845a
commit
7431c398d8
1 changed files with 34 additions and 9 deletions
|
@ -2140,18 +2140,43 @@ qbyte *R_MarkLeaves_Q1 (void)
|
||||||
|
|
||||||
r_visframecount++;
|
r_visframecount++;
|
||||||
|
|
||||||
for (i=0 ; i<cl.worldmodel->numclusters ; i++)
|
if (r_viewleaf && r_viewleaf->contents == Q1CONTENTS_SOLID)
|
||||||
{
|
{
|
||||||
if (vis[i>>3] & (1<<(i&7)))
|
//to improve spectating, when the camera is in a wall, we ignore any sky leafs.
|
||||||
|
//this prevents seeing the upwards-facing sky surfaces within the sky volumes.
|
||||||
|
//this will not affect inwards facing sky, so sky will basically appear as though it is identical to solid brushes.
|
||||||
|
for (i=0 ; i<cl.worldmodel->numclusters ; i++)
|
||||||
{
|
{
|
||||||
node = (mnode_t *)&cl.worldmodel->leafs[i+1];
|
if (vis[i>>3] & (1<<(i&7)))
|
||||||
do
|
|
||||||
{
|
{
|
||||||
if (node->visframe == r_visframecount)
|
if (cl.worldmodel->leafs[i+1].contents == Q1CONTENTS_SKY)
|
||||||
break;
|
continue;
|
||||||
node->visframe = r_visframecount;
|
node = (mnode_t *)&cl.worldmodel->leafs[i+1];
|
||||||
node = node->parent;
|
do
|
||||||
} while (node);
|
{
|
||||||
|
if (node->visframe == r_visframecount)
|
||||||
|
break;
|
||||||
|
node->visframe = r_visframecount;
|
||||||
|
node = node->parent;
|
||||||
|
} while (node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (i=0 ; i<cl.worldmodel->numclusters ; i++)
|
||||||
|
{
|
||||||
|
if (vis[i>>3] & (1<<(i&7)))
|
||||||
|
{
|
||||||
|
node = (mnode_t *)&cl.worldmodel->leafs[i+1];
|
||||||
|
do
|
||||||
|
{
|
||||||
|
if (node->visframe == r_visframecount)
|
||||||
|
break;
|
||||||
|
node->visframe = r_visframecount;
|
||||||
|
node = node->parent;
|
||||||
|
} while (node);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return vis;
|
return vis;
|
||||||
|
|
Loading…
Reference in a new issue