1 // Copyright (C) 2007 Ole Laursen
2 // Copyright (C) 2007, 2008, 2009 Ben Asselstine
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 3 of the License, or
7 // (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Library General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
28 #include "Configuration.h"
30 #include "GraphicsCache.h"
34 #include "main-window.h"
37 sigc::connection on_timer_registered(Timing::timer_slot s, int msecs_interval)
39 return Glib::signal_timeout().connect(s, msecs_interval);
43 int main(int argc, char* argv[])
45 srand(time(NULL)); // set the random seed
47 initialize_configuration();
48 Vector<int>::setMaximumWidth(1000);
50 setlocale(LC_ALL, Configuration::s_lang.c_str());
51 textdomain ("lordsawar");
53 // Check if armysets are in the path (otherwise exit)
54 Armyset::scanSystemCollection();
57 g_set_application_name(_("LordsAWar! Scenario Editor"));
58 Timing::instance().timer_registered.connect(
59 sigc::ptr_fun(on_timer_registered));
62 MainWindow* main_window = NULL;
65 Gtk::Main kit(argc, argv);
67 MainWindow* main_window;
69 main_window = new MainWindow (argv[1]);
71 main_window = new MainWindow;
75 kit.run(main_window->get_window());
77 catch (const Glib::Error &ex) {
78 std::cerr << ex.what() << std::endl;