mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-02 22:11:22 +00:00
R_CullSurfaces: small optimization. Avoid doing (s->visframe == r_visframecount) test on all world surfaces, instead, use the surfaces in the world texture chains, which already passed that test in R_MarkSurfaces.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@991 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
093ecad80b
commit
d8a33d73cc
1 changed files with 10 additions and 3 deletions
|
@ -203,14 +203,21 @@ void R_CullSurfaces (void)
|
|||
{
|
||||
msurface_t *s;
|
||||
int i;
|
||||
texture_t *t;
|
||||
|
||||
if (!r_drawworld_cheatsafe)
|
||||
return;
|
||||
|
||||
s = &cl.worldmodel->surfaces[cl.worldmodel->firstmodelsurface];
|
||||
for (i=0 ; i<cl.worldmodel->nummodelsurfaces ; i++, s++)
|
||||
// ericw -- instead of testing (s->visframe == r_visframecount) on all world
|
||||
// surfaces, use the chained surfaces, which is exactly the same set of sufaces
|
||||
for (i=0 ; i<cl.worldmodel->numtextures ; i++)
|
||||
{
|
||||
if (s->visframe == r_visframecount)
|
||||
t = cl.worldmodel->textures[i];
|
||||
|
||||
if (!t || !t->texturechains[chain_world])
|
||||
continue;
|
||||
|
||||
for (s = t->texturechains[chain_world]; s; s = s->texturechain)
|
||||
{
|
||||
if (R_CullBox(s->mins, s->maxs) || R_BackFaceCull (s))
|
||||
s->culled = true;
|
||||
|
|
Loading…
Reference in a new issue