]> git.tdb.fi Git - netvis.git/commitdiff
Tick new and reappearing hosts a few times to put them in sensible locations
authorMikko Rasa <tdb@tdb.fi>
Sun, 25 Oct 2009 13:01:45 +0000 (13:01 +0000)
committerMikko Rasa <tdb@tdb.fi>
Sun, 25 Oct 2009 13:01:45 +0000 (13:01 +0000)
source/netvis.cpp

index ff05507a2fc04364d31d1814037b9c247b1bdbbe..3aff9cd48ef210a3f543a8e2adc2e5f258773ed9 100644 (file)
@@ -135,6 +135,8 @@ void NetVis::tick()
                {
                        i->second->set_active(true);
                        hosts.insert(*i);
+                       for(unsigned j=0; j<100; ++j)
+                               i->second->tick(100*Time::msec);
                        disabled_hosts.erase(i++);
                }
                else if(i->second->get_activity()<del_limit)
@@ -248,6 +250,8 @@ Host &NetVis::get_host(unsigned a)
                host->set_local(true);
        resolver->push(host);
        host->set_position(Vector2(rand()*400.0/RAND_MAX-200.0, rand()*400.0/RAND_MAX-200.0));
+       for(unsigned j=0; j<100; ++j)
+               host->tick(100*Time::msec);
        hosts[a] = host;
        return *host;
 }