]> git.itanic.dy.fi Git - sdl-planets/blobdiff - planet.c
Move quadtree comparison code inside quadtree.c
[sdl-planets] / planet.c
index 39f8c35b3a7e8084303bcdc76f04b263c6f724d5..24b2d21da259f90d280ee6fd76bfb475d23221ee 100644 (file)
--- a/planet.c
+++ b/planet.c
@@ -374,25 +374,6 @@ void print_planet(const struct planet *p)
               p->tree.pos.x, p->tree.pos.y, p->speed.x, p->speed.y, p->mass, p->radius);
 }
 
-int planet_spatial_compare(struct quadtree *ta, struct quadtree *tb)
-{
-       struct planet *a, *b;
-       int up, left;
-       a = tree_to_planet(ta);
-       b = tree_to_planet(tb);
-
-       up = b->tree.pos.y < a->tree.pos.y;
-       left = b->tree.pos.x < a->tree.pos.x;
-
-       if (up && left)
-               return 0;
-       if (up && !left)
-               return 1;
-       if (left)
-               return 2;
-       return 3;
-}
-
 int planet_search_rectangular(struct quadtree *node,
                              struct quadtree_iterator *itr)
 {
@@ -460,7 +441,6 @@ static void planet_recalculate_stats(struct quadtree *node)
 }
 
 struct quadtree_ops planet_ops = {
-       .compare = planet_spatial_compare,
        .recalculate_stats = planet_recalculate_stats,
 };