{
window.get_display().tick();
+ for(list<Train *>::iterator i=new_trains.begin(); i!=new_trains.end(); ++i)
+ process_new_train(**i);
+ new_trains.clear();
+
layout.tick();
event_disp.tick(Time::zero);
return layout.pick_track(Vector(start.x, start.y, start.z), Vector(ray.x, ray.y, ray.z));
}
-void Engineer::train_added(Train &train)
+void Engineer::process_new_train(Train &train)
{
TrainPanel *tpanel = new TrainPanel(*this, train);
root->add(*tpanel);
Vehicle3D &loco3d = layout_3d.get_vehicle(train.get_vehicle(0));
overlay->set_label(loco3d, train.get_name());
train.signal_name_changed.connect(sigc::bind<0>(sigc::mem_fun(overlay, &Overlay3D::set_label), sigc::ref(loco3d)));
+}
+
+void Engineer::train_added(Train &train)
+{
+ new_trains.push_back(&train);
GL::Color best_color;
float best_d_sq = 0;
Msp::GL::Mesh arrow_mesh;
MainPanel *main_panel;
+ std::list<R2C2::Train *> new_trains;
std::list<TrainPanel *> train_panels;
std::list<TrainView *> train_views;
Msp::Time::TimeStamp status_timeout;
void block_reserved(const R2C2::Block &, const R2C2::Train *);
R2C2::Track *pick_track(const R2C2::Vector &);
void train_added(R2C2::Train &);
+ void process_new_train(R2C2::Train &);
virtual void sighandler(int);
};