]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - portals.c
moved brushq1 nodes/leafs/leaffaces/planes/portals fields to brush, along with brushq...
[xonotic/darkplaces.git] / portals.c
index cf47208280b7daebda8c59b916c91483c6f0c553..f2b28993d28418aa34892e9733ac7535105121c3 100644 (file)
--- a/portals.c
+++ b/portals.c
@@ -193,7 +193,7 @@ int Portal_CheckPolygon(model_t *model, vec3_t eye, float *polypoints, int numpo
        portal_markid++;
 
        Mod_CheckLoaded(model);
-       Portal_PolygonRecursiveMarkLeafs(model->brushq1.nodes, polypoints, numpoints);
+       Portal_PolygonRecursiveMarkLeafs(model->brush.data_nodes, polypoints, numpoints);
 
        eyeleaf = model->brushq1.PointInLeaf(model, eye);
 
@@ -334,12 +334,12 @@ typedef struct portalrecursioninfo_s
 }
 portalrecursioninfo_t;
 
-void Portal_RecursiveFlow_ExactMarkSurfaces(portalrecursioninfo_t *info, int *mark, int nummarksurfaces, int firstclipplane, int numclipplanes)
+void Portal_RecursiveFlow_ExactLeafFaces(portalrecursioninfo_t *info, int *mark, int numleaffaces, int firstclipplane, int numclipplanes)
 {
        int i, j, *elements;
        vec3_t trimins, trimaxs;
        msurface_t *surf;
-       for (i = 0;i < nummarksurfaces;i++, mark++)
+       for (i = 0;i < numleaffaces;i++, mark++)
        {
                if (!info->surfacemark[*mark])
                {
@@ -402,16 +402,16 @@ void Portal_RecursiveFlow (portalrecursioninfo_t *info, mleaf_t *leaf, int first
        }
 
        if (info->leafmark)
-               info->leafmark[leaf - info->model->brushq1.data_leafs] = true;
+               info->leafmark[leaf - info->model->brush.data_leafs] = true;
 
        // mark surfaces in leaf that can be seen through portal
-       if (leaf->nummarksurfaces && info->surfacemark)
+       if (leaf->numleaffaces && info->surfacemark)
        {
                if (info->exact)
-                       Portal_RecursiveFlow_ExactMarkSurfaces(info, leaf->firstmarksurface, leaf->nummarksurfaces, firstclipplane, numclipplanes);
+                       Portal_RecursiveFlow_ExactLeafFaces(info, leaf->firstleafface, leaf->numleaffaces, firstclipplane, numclipplanes);
                else
-                       for (i = 0;i < leaf->nummarksurfaces;i++)
-                               info->surfacemark[leaf->firstmarksurface[i]] = true;
+                       for (i = 0;i < leaf->numleaffaces;i++)
+                               info->surfacemark[leaf->firstleafface[i]] = true;
        }
 
        // follow portals into other leafs
@@ -490,7 +490,7 @@ void Portal_Visibility(model_t *model, const vec3_t eye, qbyte *leafmark, qbyte
 
        Mod_CheckLoaded(model);
 
-       if (!model->brushq1.numportals)
+       if (!model->brush.num_portals)
        {
                Con_Print("Portal_Visibility: not a brush model\n");
                return;
@@ -517,7 +517,7 @@ void Portal_Visibility(model_t *model, const vec3_t eye, qbyte *leafmark, qbyte
        info.updateleafsmins = updateleafsmins;
        info.updateleafsmaxs = updateleafsmaxs;
 
-       Portal_RecursiveFindLeafForFlow(&info, model->brushq1.nodes);
+       Portal_RecursiveFindLeafForFlow(&info, model->brush.data_nodes);
 
        if (ranoutofportalplanes)
                Con_Printf("Portal_RecursiveFlow: ran out of %d plane stack when recursing through portals\n", MAXRECURSIVEPORTALPLANES);