]> git.itanic.dy.fi Git - sdl-planets/commitdiff
sync with master
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Sun, 11 Apr 2010 09:20:15 +0000 (12:20 +0300)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Sun, 11 Apr 2010 09:20:15 +0000 (12:20 +0300)
main.c
planet.c
quadtree.c

diff --git a/main.c b/main.c
index dfcfaa0bd50b48d415f4b619a47113117f9b0463..8be3330f3128802b82ff307062f516478ad39196 100644 (file)
--- a/main.c
+++ b/main.c
@@ -218,9 +218,6 @@ static void loop(SDL_Surface *screen, int num_of_planets, double total_mass,
        while (1) {
                planets = 0;
 
-               if (!time)
-                       goto skip;
-
                list_for_each_entry(pl1, &planet->list, list) {
                        pl2 = list_to_planet(pl1->list.next);
                        list_for_each_entry_from(pl2, &planet->list, list) {
@@ -240,7 +237,6 @@ static void loop(SDL_Surface *screen, int num_of_planets, double total_mass,
 
                move_camera(&camera, true_time);
 
-skip:
                if (poll_events(&status, true_time))
                        return;
 
index c0a5ff61dcaec22e1b8243e14d0d7ccca53fe7ff..de0e49fa2d2bdb3138ed46e9aec54e15fc85232d 100644 (file)
--- a/planet.c
+++ b/planet.c
@@ -262,7 +262,7 @@ struct planet *move_planet(struct planet *p, const double time)
 
        /* Check if we have crossed any of the parents */
        parent = p->tree.parent;
-       while(parent) {
+       while (parent) {
                pa = tree_to_planet(parent);
                if (p->pos.x < pa->pos.x && new_pos.x > pa->pos.x)
                        modify = 1;
@@ -284,6 +284,10 @@ struct planet *move_planet(struct planet *p, const double time)
                return tree_to_planet(tree_parent);
        }
 
+       /*
+        * Now, search the subtree for any crossed children and move
+        * them into correct place within the tree.
+        */
        it.qt_iterator.head = &p->tree;
        it.limit[0] = p->pos;
        it.limit[1] = new_pos;
index e827595309fe549425c6594a51a7a7a56ef0178c..f188d8069ee38a5426403304c97e5e485eb9186a 100644 (file)
@@ -9,7 +9,7 @@
 #define debug 0
 #endif
 
-static void trap(void )
+static void trap(void)
 {
        if (debug)
                exit(1);