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:
Spoike 2015-01-09 06:32:48 +00:00
parent b7a4b8845a
commit 7431c398d8
1 changed files with 34 additions and 9 deletions

View File

@ -2140,18 +2140,43 @@ qbyte *R_MarkLeaves_Q1 (void)
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];
do
if (vis[i>>3] & (1<<(i&7)))
{
if (node->visframe == r_visframecount)
break;
node->visframe = r_visframecount;
node = node->parent;
} while (node);
if (cl.worldmodel->leafs[i+1].contents == Q1CONTENTS_SKY)
continue;
node = (mnode_t *)&cl.worldmodel->leafs[i+1];
do
{
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;