]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Reduce BIH node size by 32 bytes
authoruis <uis9936@gmail.com>
Sun, 21 Apr 2024 00:59:09 +0000 (03:59 +0300)
committeruis <uis9936@gmail.com>
Sun, 21 Apr 2024 00:59:09 +0000 (03:59 +0300)
bih.h

diff --git a/bih.h b/bih.h
index 9b48becd4f2a32d7b70657630678dc83baceb1b6..32b1d4b5d3a3d1b87469ae3ba6623697ee09f247 100644 (file)
--- a/bih.h
+++ b/bih.h
@@ -39,14 +39,18 @@ typedef struct bih_node_s
        // TODO: move bounds data to parent node and remove it from leafs?
        float mins[3];
        float maxs[3];
-       // node indexes of children (always > this node's index)
-       int front;
-       int back;
-       // interval of children
-       float frontmin; // children[0]
-       float backmax; // children[1]
-       // BIH_UNORDERED uses this for a list of leafindex (all >= 0), -1 = end of list
-       int children[BIH_MAXUNORDEREDCHILDREN];
+       union {
+               struct{
+                       // node indexes of children (always > this node's index)
+                       int front;
+                       int back;
+                       // interval of children
+                       float frontmin; // children[0]
+                       float backmax; // children[1]
+               };
+               // BIH_UNORDERED uses this for a list of leafindex (all >= 0), -1 = end of list
+               int children[BIH_MAXUNORDEREDCHILDREN];
+       };
 }
 bih_node_t;