Sun, 11 Aug 2013 03:05:24 +0300
added missing files
1 | 1 | #include <QApplication> |
3
d0b278fd29d5
Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents:
2
diff
changeset
|
2 | #include <QSettings> |
0 | 3 | #include "types.h" |
1 | 4 | #include "config.h" |
6
67b6ef6917ba
Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
5
diff
changeset
|
5 | #include "demo.h" |
0 | 6 | |
1 | 7 | // ============================================================================= |
8 | // ----------------------------------------------------------------------------- | |
11
3ddebf76105e
made style more consistent
Teemu Piippo <crimsondusk64@gmail.com>
parents:
10
diff
changeset
|
9 | int main (int argc, char* argv[]) { |
3ddebf76105e
made style more consistent
Teemu Piippo <crimsondusk64@gmail.com>
parents:
10
diff
changeset
|
10 | QApplication app (argc, argv); |
3ddebf76105e
made style more consistent
Teemu Piippo <crimsondusk64@gmail.com>
parents:
10
diff
changeset
|
11 | app.setApplicationName (UNIXNAME); |
3ddebf76105e
made style more consistent
Teemu Piippo <crimsondusk64@gmail.com>
parents:
10
diff
changeset
|
12 | app.setOrganizationName (UNIXNAME); |
3ddebf76105e
made style more consistent
Teemu Piippo <crimsondusk64@gmail.com>
parents:
10
diff
changeset
|
13 | app.setApplicationVersion (versionString()); |
3
d0b278fd29d5
Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents:
2
diff
changeset
|
14 | |
11
3ddebf76105e
made style more consistent
Teemu Piippo <crimsondusk64@gmail.com>
parents:
10
diff
changeset
|
15 | for (int i = 1; i < argc; ++i) { |
1 | 16 | str arg = argv[i]; |
17 | ||
11
3ddebf76105e
made style more consistent
Teemu Piippo <crimsondusk64@gmail.com>
parents:
10
diff
changeset
|
18 | if (arg == "--config") { |
5
3c04e05ab24f
Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents:
3
diff
changeset
|
19 | ConfigBox dlg; |
3c04e05ab24f
Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents:
3
diff
changeset
|
20 | return dlg.exec(); |
1 | 21 | } |
22 | } | |
23 | ||
11
3ddebf76105e
made style more consistent
Teemu Piippo <crimsondusk64@gmail.com>
parents:
10
diff
changeset
|
24 | if (argc != 2) { |
3ddebf76105e
made style more consistent
Teemu Piippo <crimsondusk64@gmail.com>
parents:
10
diff
changeset
|
25 | fprint (stderr, "Usage: %1 <demo> - Launch a demo file\n", argv[0]); |
3ddebf76105e
made style more consistent
Teemu Piippo <crimsondusk64@gmail.com>
parents:
10
diff
changeset
|
26 | fprint (stderr, " %1 --config - Configure " APPNAME "\n", argv[0]); |
6
67b6ef6917ba
Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
5
diff
changeset
|
27 | return 255; |
67b6ef6917ba
Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
5
diff
changeset
|
28 | } |
67b6ef6917ba
Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
5
diff
changeset
|
29 | |
11
3ddebf76105e
made style more consistent
Teemu Piippo <crimsondusk64@gmail.com>
parents:
10
diff
changeset
|
30 | return launchDemo (argv[1]); |
0 | 31 | } |
32 | ||
1 | 33 | // ============================================================================= |
34 | // ----------------------------------------------------------------------------- | |
5
3c04e05ab24f
Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents:
3
diff
changeset
|
35 | str versionString() { |
11
3ddebf76105e
made style more consistent
Teemu Piippo <crimsondusk64@gmail.com>
parents:
10
diff
changeset
|
36 | str text = fmt ("v%1.%2", VERSION_MAJOR, VERSION_MINOR); |
0 | 37 | #if VERSION_PATCH != 0 |
11
3ddebf76105e
made style more consistent
Teemu Piippo <crimsondusk64@gmail.com>
parents:
10
diff
changeset
|
38 | text += fmt (".%1", VERSION_PATCH); |
0 | 39 | #endif |
40 | ||
41 | #if BUILD_ID == BUILD_INTERNAL | |
42 | text += "-intern"; | |
43 | #elif BUILD_ID == BUILD_ALPHA | |
44 | text += "-alpha"; | |
45 | #elif BUILD_ID == BUILD_BETA | |
46 | text += "-beta"; | |
47 | #elif BUILD_ID == BUILD_RC | |
11
3ddebf76105e
made style more consistent
Teemu Piippo <crimsondusk64@gmail.com>
parents:
10
diff
changeset
|
48 | text += fmt ("-rc%1", RC_ID); |
0 | 49 | #elif BUILD_ID == BUILD_RELEASE |
50 | text += "-rel"; | |
51 | #else | |
52 | # error Invalid build code! | |
53 | #endif // BUILD_ID | |
54 | ||
55 | return text; | |
11
3ddebf76105e
made style more consistent
Teemu Piippo <crimsondusk64@gmail.com>
parents:
10
diff
changeset
|
56 | } |