1
// This program is free software; you can redistribute it and/or modify
2
// it under the terms of the GNU General Public License as published by
3
// the Free Software Foundation; either version 2 of the License, or
4
// (at your option) any later version.
6
// This program is distributed in the hope that it will be useful,
7
// but WITHOUT ANY WARRANTY; without even the implied warranty of
8
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9
// GNU Library General Public License for more details.
11
// You should have received a copy of the GNU General Public License
12
// along with this program; if not, write to the Free Software
13
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
#include <gtkmm/main.h>
23
#include "../Configuration.h"
25
#include "../GraphicsCache.h"
26
#include "../timing.h"
28
#include "main-window.h"
31
sigc::connection on_timer_registered(Timing::timer_slot s, int msecs_interval)
33
return Glib::signal_timeout().connect(s, msecs_interval);
36
int main(int argc, char* argv[])
38
srand(time(NULL)); // set the random seed
40
initialize_configuration();
42
setlocale(LC_ALL, Configuration::s_lang.c_str());
44
bindtextdomain ("lordsawar",PO_PATH);
46
bindtextdomain ("lordsawar","./locale/");
48
textdomain ("lordsawar");
50
// Check if armysets are in the path (otherwise exit)
54
g_set_application_name(_("LordsAWar! Map Editor"));
55
Timing::instance().timer_registered.connect(
56
sigc::ptr_fun(on_timer_registered));
60
Gtk::Main kit(argc, argv);
62
std::auto_ptr<MainWindow> main_window(new MainWindow);
63
main_window->init(640, 480);
65
main_window->sdl_initialized.connect(
66
sigc::mem_fun(main_window.get(), &MainWindow::show_initial_map));
69
kit.run(main_window->get_window());
71
catch (const Glib::Error &ex) {
72
std::cerr << ex.what() << std::endl;