]> git.itanic.dy.fi Git - sdl-planets/blobdiff - quadtree.h
quadtree: Move quadtree_recalculate_parent_stats() out from the header
[sdl-planets] / quadtree.h
index 45478fa73a83cb711ddc7fbed69c68ac5b054803..f69f34d0784198d169d6de735cb266a09d4eda03 100644 (file)
@@ -70,33 +70,4 @@ static inline struct quadtree *quadtree_find_parent(const struct quadtree *node)
        return t;
 }
 
-/*
- * Recursively walk through the tree and propagate changes made to the
- * given node up until the highest parent.
- */
-static inline void quadtree_recalculate_parent_stats(struct quadtree *node,
-                                                    struct quadtree_ops *ops)
-{
-       int i;
-
-       while (node) {
-               node->depth = 0;
-               node->children = 0;
-
-               for (i = 0; i < 4; i++) {
-                       if (!node->child[i])
-                               continue;
-
-                       node->depth = MAX(node->depth,
-                                         node->child[i]->depth + 1);
-                       node->children += node->child[i]->children + 1;
-               }
-
-               if (ops->recalculate_stats)
-                       ops->recalculate_stats(node);
-
-               node = node->parent;
-       }
-}
-
 #endif