]> git.itanic.dy.fi Git - sdl-planets/blobdiff - quadtree.c
quadtree: Reduce excess stats calculation
[sdl-planets] / quadtree.c
index 1cb97563874d51770f73a89c7183883d934dbd43..5412b8031cf2fe3007aa8a350105473931a5ca50 100644 (file)
@@ -820,12 +820,12 @@ struct quadtree *quadtree_move(struct quadtree *node, struct vector new_pos,
                tree_parent = quadtree_del(node, ops);
                node->pos = new_pos;
                quadtree_add(tree_parent, node, ops);
-               quadtree_recalculate_parent_stats(node, ops);
                return tree_parent;
        }
 
        /* Move the node into its new location */
        node->pos = new_pos;
+       recalculate_parent_area_stats(node);
 
        if (node->children) {
                /*
@@ -840,7 +840,6 @@ struct quadtree *quadtree_move(struct quadtree *node, struct vector new_pos,
                check_for_crossed_subnodes(node, limit, ops);
        }
 
-       quadtree_recalculate_parent_stats(node, ops);
        return quadtree_find_parent(node);
 
 }