]> git.itanic.dy.fi Git - sdl-planets/commit
quadtree: Try to keep the tree in better balance.
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Sat, 24 Apr 2010 11:00:49 +0000 (14:00 +0300)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Sat, 24 Apr 2010 11:00:49 +0000 (14:00 +0300)
commit599ac8f467bde1e71e8a2b034d9988c6b1cb3807
tree5990322fee207f8c82cf61f375a02b524b05fdff
parent29fe1630973392185731f4289537e29365d315fc
quadtree: Try to keep the tree in better balance.

When a tree node is removed, we now attempt to add the detached
subtree in more optimized order to the new tree. This is done so that
we walk down the detached tree and add a new node to the main tree
always when the tree is one quarter'th smaller than the previous node
that was added.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
quadtree.c