- string res;
- bool debug=false;
- string device="/dev/ttyS0";
- unsigned quality=4;
-
- GetOpt getopt;
- getopt.add_option('r', "resolution", res, GetOpt::REQUIRED_ARG);
- getopt.add_option('f', "fullscreen", fullscreen, GetOpt::NO_ARG);
- getopt.add_option('g', "debug", debug, GetOpt::NO_ARG);
- getopt.add_option('d', "device", device, GetOpt::REQUIRED_ARG);
- getopt.add_option('q', "quality", quality, GetOpt::REQUIRED_ARG);
- getopt.add_option('s', "simulate", simulate, GetOpt::NO_ARG);
- getopt.add_option( "no-lighting", no_lighting, GetOpt::NO_ARG);
- getopt(argc, argv);
-
- if(!res.empty())
+ // Setup GUI
+ window.set_title("Railroad Engineer");
+ window.signal_close.connect(sigc::bind(sigc::mem_fun(this, &Engineer::exit), 0));
+
+ root = new GLtk::Root(ui_res, &window, &keyboard, &mouse);
+ GLtk::Layout *root_layout = new GLtk::Layout;
+ root->set_layout(root_layout);
+ root_layout->set_margin(GLtk::Sides());
+ root_arrangement = new GLtk::FloatingArrangement(*root_layout);
+ mouse.signal_button_press.connect(sigc::bind_return(sigc::mem_fun(this, &Engineer::button_press), false));
+ mouse.signal_axis_motion.connect(sigc::bind_return(sigc::mem_fun(this, &Engineer::axis_motion), false));
+ root->set_visible(true);
+
+ 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())