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