When user has set the simulation speed to zero, there is no need to
run the simulation at all, as it won't be changing anyway. This makes
it possible to run excessively large simulations and occassionally
freeze the simulation. Then, for example, inspecting the tree topology
(if draw_lines variable is enabled) becomes easier without need to
worry about slow camera movement.
Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
- list_for_each_entry(pl1, &planet->list, list) {
- pl2 = list_to_planet(pl1->list.next);
- list_for_each_entry_from(pl2, &planet->list, list) {
- struct planet *ptmp;
- if (!gravitize_planets(pl1, pl2,
- step_time))
- continue;
-
- ptmp = list_to_planet(pl2->list.prev);
- merge_planets(pl1, pl2);
- pl2 = ptmp;
+ if (status.time_scale > 0) {
+ list_for_each_entry(pl1, &planet->list, list) {
+ pl2 = list_to_planet(pl1->list.next);
+ list_for_each_entry_from(pl2, &planet->list,
+ list) {
+ struct planet *ptmp;
+ if (!gravitize_planets(pl1, pl2,
+ step_time))
+ continue;
+
+ ptmp = list_to_planet(pl2->list.prev);
+ merge_planets(pl1, pl2);
+ pl2 = ptmp;
+ }
+
+ planet_root = move_planet(pl1, step_time);
+ planets++;
-
- planet_root = move_planet(pl1, step_time);
- planets++;
move_camera(&camera, true_time);
if (poll_events(&status, true_time))
move_camera(&camera, true_time);
if (poll_events(&status, true_time))