33 #include "dialogs.h" |
34 #include "dialogs.h" |
34 #include "crashcatcher.h" |
35 #include "crashcatcher.h" |
35 |
36 |
36 QList<LDDocument*> g_loadedFiles; |
37 QList<LDDocument*> g_loadedFiles; |
37 ForgeWindow* g_win = null; |
38 ForgeWindow* g_win = null; |
38 const QApplication* g_app = null; |
|
39 static QString g_versionString, g_fullVersionString; |
39 static QString g_versionString, g_fullVersionString; |
40 |
40 |
41 const Vertex g_origin (0.0f, 0.0f, 0.0f); |
41 const Vertex g_origin (0.0f, 0.0f, 0.0f); |
42 const Matrix g_identity ({1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f}); |
42 const Matrix g_identity ({1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f}); |
43 |
43 |
44 cfg (Bool, firststart, true); |
44 cfg (Bool, firststart, true); |
|
45 |
|
46 static QString g_argv0; |
|
47 |
|
48 QString getApplicationDirectory() |
|
49 { |
|
50 assert (g_argv0.isEmpty() == false); |
|
51 |
|
52 if (g_argv0.indexOf (DIRSLASH) != -1) |
|
53 return dirname (g_argv0); |
|
54 |
|
55 return "."; |
|
56 } |
45 |
57 |
46 // ============================================================================= |
58 // ============================================================================= |
47 // ----------------------------------------------------------------------------- |
59 // ----------------------------------------------------------------------------- |
48 int main (int argc, char* argv[]) |
60 int main (int argc, char* argv[]) |
49 { |
61 { |
50 QApplication app (argc, argv); |
62 QApplication app (argc, argv); |
51 app.setOrganizationName (APPNAME); |
63 app.setOrganizationName (APPNAME); |
52 app.setApplicationName (APPNAME); |
64 app.setApplicationName (APPNAME); |
53 g_app = &app; |
65 g_argv0 = argv[0]; |
54 |
|
55 initCrashCatcher(); |
66 initCrashCatcher(); |
56 LDDocument::setCurrent (null); |
67 LDDocument::setCurrent (null); |
57 |
68 |
58 // Load or create the configuration |
69 // Load or create the configuration |
59 if (!Config::load()) |
70 if (!Config::load()) |