+ main_wnd = new MainWindow(*this);
+ root->add(*main_wnd);
+ main_wnd->autosize();
+ main_wnd->set_position(0, window.get_height()-main_wnd->get_geometry().h);
+
+ overlay = new Overlay3D(ui_res.get_default_font());
+
+ // Setup railroad control
+ DataFile::load(catalogue, "tracks.dat");
+ DataFile::load(catalogue, "locos.dat");
+ DataFile::load(catalogue, "wagons.dat");
+ DataFile::load(catalogue, "terrain.dat");
+ DataFile::load(layout, options.layout_fn);
+
+ if(layout.has_driver())
+ layout.get_driver().signal_locomotive_detected.connect(sigc::mem_fun(this, &Engineer::locomotive_detected));
+ layout.signal_train_added.connect(sigc::mem_fun(this, &Engineer::train_added));
+ layout.signal_emergency.connect(sigc::mem_fun(this, &Engineer::set_status));
+ const set<Block *> &blocks = layout.get_all<Block>();
+ for(set<Block *>::const_iterator i=blocks.begin(); i!=blocks.end(); ++i)
+ if(TrackCircuit *tc = (*i)->get_sensor())
+ new TrackCircuit3D(layout_3d, *tc);
+
+ const set<Track *> &tracks = layout.get_all<Track>();
+ for(set<Track *>::const_iterator i=tracks.begin(); i!=tracks.end(); ++i)
+ if((*i)->get_type().is_turnout())
+ new Path3D(layout_3d.get_3d(**i));