]> git.itanic.dy.fi Git - sdl-planets/blobdiff - quadtree.c
quadtree: Pass quadtree iterator structure to the callback functions
[sdl-planets] / quadtree.c
index 327ee2092b44a2646c39b1b2189a28b1e1ea4768..66cdf2847a146f291d95fb40cf288e68847140ae 100644 (file)
@@ -212,7 +212,7 @@ static int _walk_tree(struct quadtree *head, const struct quadtree_iterator *it)
 {
        int direction, count = 0;
 
-       direction = it->direction(head, it->ptr);
+       direction = it->direction(head, (struct quadtree_iterator *)it);
 
        if ((direction & QUADTREE_UPLEFT) && head->child[0])
                count += _walk_tree(head->child[0], it);
@@ -227,7 +227,7 @@ static int _walk_tree(struct quadtree *head, const struct quadtree_iterator *it)
                count += _walk_tree(head->child[3], it);
 
        if ((direction & QUADTREE_SELF) && it->callback) {
-               it->callback(head, it->ptr);
+               it->callback(head, (struct quadtree_iterator *)it);
                count++;
        }