]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fixed a flaw in the culling in
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 9 Mar 2011 09:13:52 +0000 (09:13 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 9 Mar 2011 09:13:52 +0000 (09:13 +0000)
Mod_Q1BSP_TraceLineAgainstSurfacesFindTextureOnNode which was preventing
culling from working in most cases, minor speed gain

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10905 d7cf8633-e32d-0410-b094-e92efae38249

model_brush.c

index 7786be2d7f8936205c474bc4ecfedfd0cf05589a..e7a922688e854e1252b02462e2aadc96205cf8f9 100644 (file)
@@ -1298,7 +1298,6 @@ static const texture_t *Mod_Q1BSP_TraceLineAgainstSurfacesFindTextureOnNode(Recu
        int i;
        int j;
        int k;
-       int axis = node->plane->type;
        const msurface_t *surface;
        float normal[3];
        float v0[3];
@@ -1315,16 +1314,8 @@ static const texture_t *Mod_Q1BSP_TraceLineAgainstSurfacesFindTextureOnNode(Recu
        for (i = 0;i < node->numsurfaces;i++, surface++)
        {
                // skip surfaces whose bounding box does not include the point
-               if (axis < 3)
-               {
-                       if (mid[axis] < surface->mins[axis] || mid[axis] > surface->maxs[axis])
-                               continue;
-               }
-               else
-               {
-                       if (!BoxesOverlap(mid, mid, surface->mins, surface->maxs))
-                               continue;
-               }
+               if (!BoxesOverlap(mid, mid, surface->mins, surface->maxs))
+                       continue;
                // skip faces with contents we don't care about
                if (!(t->trace->hitsupercontentsmask & surface->texture->supercontents))
                        continue;