launcher/demo.cpp

Sun, 28 Nov 2021 23:53:23 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Sun, 28 Nov 2021 23:53:23 +0200
changeset 66
c68545f1aecb
parent 64
c55e46b7ddeb
permissions
-rw-r--r--

Simplify ZandronumVersion structure

13
9bdddd2ccde6 now with 3691% extra legalese!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 11
diff changeset
1 /*
30
6b82f6a3ad53 renamed the project to ZCinema
Teemu Piippo <crimsondusk64@gmail.com>
parents: 26
diff changeset
2 * ZCinema: Zandronum demo launcher
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
3 * Copyright (C) 2013-2015 Teemu Piippo
13
9bdddd2ccde6 now with 3691% extra legalese!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 11
diff changeset
4 *
9bdddd2ccde6 now with 3691% extra legalese!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 11
diff changeset
5 * This program is free software: you can redistribute it and/or modify
9bdddd2ccde6 now with 3691% extra legalese!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 11
diff changeset
6 * it under the terms of the GNU General Public License as published by
9bdddd2ccde6 now with 3691% extra legalese!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 11
diff changeset
7 * the Free Software Foundation, either version 3 of the License, or
9bdddd2ccde6 now with 3691% extra legalese!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 11
diff changeset
8 * (at your option) any later version.
9bdddd2ccde6 now with 3691% extra legalese!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 11
diff changeset
9 *
9bdddd2ccde6 now with 3691% extra legalese!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 11
diff changeset
10 * This program is distributed in the hope that it will be useful,
9bdddd2ccde6 now with 3691% extra legalese!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 11
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9bdddd2ccde6 now with 3691% extra legalese!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 11
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9bdddd2ccde6 now with 3691% extra legalese!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 11
diff changeset
13 * GNU General Public License for more details.
9bdddd2ccde6 now with 3691% extra legalese!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 11
diff changeset
14 *
9bdddd2ccde6 now with 3691% extra legalese!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 11
diff changeset
15 * You should have received a copy of the GNU General Public License
9bdddd2ccde6 now with 3691% extra legalese!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 11
diff changeset
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
9bdddd2ccde6 now with 3691% extra legalese!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 11
diff changeset
17 */
9bdddd2ccde6 now with 3691% extra legalese!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 11
diff changeset
18
6
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
19 #include <QFile>
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
20 #include <QDataStream>
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
21 #include <QMessageBox>
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
22 #include <QProcess>
48
e121ea9dba93 Now C++03 compatible
Teemu Piippo <crimsondusk64@gmail.com>
parents: 46
diff changeset
23 #include <errno.h>
51
5e4bd3b212ce Fixed the demo not loading properly when the user is prompted for the binary path
Teemu Piippo <tsapii@utu.fi>
parents: 48
diff changeset
24 #include <assert.h>
46
07578e081ae8 Renamed the src* directories into commonlib/, config/ and launcher/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 45
diff changeset
25 #include <commonlib/misc.h>
07578e081ae8 Renamed the src* directories into commonlib/, config/ and launcher/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 45
diff changeset
26 #include <commonlib/config.h>
07578e081ae8 Renamed the src* directories into commonlib/, config/ and launcher/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 45
diff changeset
27 #include <commonlib/version.h>
6
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
28 #include "demo.h"
46
07578e081ae8 Renamed the src* directories into commonlib/, config/ and launcher/
Teemu Piippo <crimsondusk64@gmail.com>
parents: 45
diff changeset
29 #include "prompts.h"
8
e8f645d9f28f Added a prompt for demo information
Teemu Piippo <crimsondusk64@gmail.com>
parents: 6
diff changeset
30 #include "ui_demoprompt.h"
6
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
31
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
32 //
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
33 // -------------------------------------------------------------------------------------------------
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
34 //
20
a5457405cc9b Use the cfg:: namespace system I made up a while ago instead of using QSettings directly, it's unsafe
Teemu Piippo <crimsondusk64@gmail.com>
parents: 18
diff changeset
35
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
36 QString uncolorize (const QString& in)
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
37 {
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
38 // TODO: Handle long-form colors like \c[Red]
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
39 QString out;
10
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
40 int skip = 0;
41
e985ebb67fdd Removed trailing tabs
Teemu Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
41
48
e121ea9dba93 Now C++03 compatible
Teemu Piippo <crimsondusk64@gmail.com>
parents: 46
diff changeset
42 for (int i = 0; i < in.length(); ++i)
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
43 {
10
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
44 if (skip-- > 0)
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
45 continue;
41
e985ebb67fdd Removed trailing tabs
Teemu Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
46
48
e121ea9dba93 Now C++03 compatible
Teemu Piippo <crimsondusk64@gmail.com>
parents: 46
diff changeset
47 QChar ch = in[i];
e121ea9dba93 Now C++03 compatible
Teemu Piippo <crimsondusk64@gmail.com>
parents: 46
diff changeset
48
e121ea9dba93 Now C++03 compatible
Teemu Piippo <crimsondusk64@gmail.com>
parents: 46
diff changeset
49 if (ch == QChar ('\034'))
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
50 {
10
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
51 skip = 1;
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
52 continue;
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
53 }
41
e985ebb67fdd Removed trailing tabs
Teemu Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
54
48
e121ea9dba93 Now C++03 compatible
Teemu Piippo <crimsondusk64@gmail.com>
parents: 46
diff changeset
55 out += ch;
10
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
56 }
41
e985ebb67fdd Removed trailing tabs
Teemu Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
57
10
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
58 return out;
6
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
59 }
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
60
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
61 //
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
62 // -------------------------------------------------------------------------------------------------
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
63 //
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
64
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
65 static QString tr (const char* msg)
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
66 {
10
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
67 return QObject::tr (msg);
6
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
68 }
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
69
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
70 //
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
71 // -------------------------------------------------------------------------------------------------
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
72 //
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
73
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
74 static void error (QString msg)
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
75 {
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
76 QMessageBox::critical (NULL, "Error", msg);
6
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
77 }
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
78
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
79 //
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
80 // -------------------------------------------------------------------------------------------------
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
81 //
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
82
38
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
83 static ZandronumVersion findVersion (QString versionName)
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
84 {
39
2c368cf5cc19 Finally done with the new Zandronum version handling
Teemu Piippo <crimsondusk64@gmail.com>
parents: 38
diff changeset
85 QList<QVariant> versions = Config::get ("versions").toList();
2c368cf5cc19 Finally done with the new Zandronum version handling
Teemu Piippo <crimsondusk64@gmail.com>
parents: 38
diff changeset
86
2c368cf5cc19 Finally done with the new Zandronum version handling
Teemu Piippo <crimsondusk64@gmail.com>
parents: 38
diff changeset
87 for (int i = 0; i < versions.size(); ++i)
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
88 {
39
2c368cf5cc19 Finally done with the new Zandronum version handling
Teemu Piippo <crimsondusk64@gmail.com>
parents: 38
diff changeset
89 if (not versions[i].canConvert<ZandronumVersion>())
2c368cf5cc19 Finally done with the new Zandronum version handling
Teemu Piippo <crimsondusk64@gmail.com>
parents: 38
diff changeset
90 continue;
2c368cf5cc19 Finally done with the new Zandronum version handling
Teemu Piippo <crimsondusk64@gmail.com>
parents: 38
diff changeset
91
2c368cf5cc19 Finally done with the new Zandronum version handling
Teemu Piippo <crimsondusk64@gmail.com>
parents: 38
diff changeset
92 ZandronumVersion version = versions[i].value<ZandronumVersion>();
38
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
93
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
94 if (version.name == versionName
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
95 or version.name + "M" == versionName
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
96 or version.name == versionName + "M")
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
97 {
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
98 return version;
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
99 }
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
100 }
39
2c368cf5cc19 Finally done with the new Zandronum version handling
Teemu Piippo <crimsondusk64@gmail.com>
parents: 38
diff changeset
101
38
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
102 return ZandronumVersion();
10
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
103 }
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
104
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
105 //
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
106 // -------------------------------------------------------------------------------------------------
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
107 //
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
108
56
bdbbde5f754e Added the ability to automatically look up wad paths from other sources (for now just Doomseeker's configuration). By default, ZCinema will automatically do such a lookup if it fails to find a WAD needed for demo playback. This can also be invoked manually in the config prompt.
Teemu Piippo <tsapii@utu.fi>
parents: 51
diff changeset
109 static QString findWad (QString name)
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
110 {
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
111 QStringList wadpaths = Config::get ("wadpaths").toStringList();
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
112
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
113 for (int i = 0; i < wadpaths.size(); ++i)
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
114 {
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
115 QString fullpath = QString ("%1/%2").arg (wadpaths[i]).arg (name);
10
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
116 QFile f (fullpath);
41
e985ebb67fdd Removed trailing tabs
Teemu Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
117
10
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
118 if (f.exists())
6
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
119 return fullpath;
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
120 }
41
e985ebb67fdd Removed trailing tabs
Teemu Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
121
56
bdbbde5f754e Added the ability to automatically look up wad paths from other sources (for now just Doomseeker's configuration). By default, ZCinema will automatically do such a lookup if it fails to find a WAD needed for demo playback. This can also be invoked manually in the config prompt.
Teemu Piippo <tsapii@utu.fi>
parents: 51
diff changeset
122 // WAD names are case-sensitive under non-Windows and they can appear in uppercase
bdbbde5f754e Added the ability to automatically look up wad paths from other sources (for now just Doomseeker's configuration). By default, ZCinema will automatically do such a lookup if it fails to find a WAD needed for demo playback. This can also be invoked manually in the config prompt.
Teemu Piippo <tsapii@utu.fi>
parents: 51
diff changeset
123 // so we need to test that too.
bdbbde5f754e Added the ability to automatically look up wad paths from other sources (for now just Doomseeker's configuration). By default, ZCinema will automatically do such a lookup if it fails to find a WAD needed for demo playback. This can also be invoked manually in the config prompt.
Teemu Piippo <tsapii@utu.fi>
parents: 51
diff changeset
124 if (name != name.toUpper())
bdbbde5f754e Added the ability to automatically look up wad paths from other sources (for now just Doomseeker's configuration). By default, ZCinema will automatically do such a lookup if it fails to find a WAD needed for demo playback. This can also be invoked manually in the config prompt.
Teemu Piippo <tsapii@utu.fi>
parents: 51
diff changeset
125 return findWad (name.toUpper());
bdbbde5f754e Added the ability to automatically look up wad paths from other sources (for now just Doomseeker's configuration). By default, ZCinema will automatically do such a lookup if it fails to find a WAD needed for demo playback. This can also be invoked manually in the config prompt.
Teemu Piippo <tsapii@utu.fi>
parents: 51
diff changeset
126
6
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
127 return "";
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
128 }
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
129
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
130 //
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
131 // -------------------------------------------------------------------------------------------------
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
132 //
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
133
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
134 QString readString (QDataStream& stream)
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
135 {
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
136 QString out;
63
d10a6be4d99e Clean unnecessary code
Teemu Piippo <teemu@hecknology.net>
parents: 56
diff changeset
137 quint8 ch;
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
138
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
139 for (stream >> ch; ch != 0; stream >> ch)
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
140 out += QChar (ch);
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
141
22
2fe0b7e0da7b For some God-knows-why reason, adding operator>> overloads to QDataStream leads into crashes with QFileDialog. Fixed by removing these overloads.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 21
diff changeset
142 return out;
18
6bf57b4f42cd Replaced the Bytestream class with QDataStream
Teemu Piippo <crimsondusk64@gmail.com>
parents: 17
diff changeset
143 }
15
3d3e5f0fc4cc made it compile on windows/qt5
Teemu Piippo <crimsondusk64@gmail.com>
parents: 13
diff changeset
144
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
145 //
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
146 // -------------------------------------------------------------------------------------------------
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
147 //
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
148
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
149 struct UserInfo
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
150 {
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
151 QString netname;
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
152 QString skin;
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
153 QString className;
63
d10a6be4d99e Clean unnecessary code
Teemu Piippo <teemu@hecknology.net>
parents: 56
diff changeset
154 quint32 color;
d10a6be4d99e Clean unnecessary code
Teemu Piippo <teemu@hecknology.net>
parents: 56
diff changeset
155 quint32 aimdist;
d10a6be4d99e Clean unnecessary code
Teemu Piippo <teemu@hecknology.net>
parents: 56
diff changeset
156 quint32 railcolor;
d10a6be4d99e Clean unnecessary code
Teemu Piippo <teemu@hecknology.net>
parents: 56
diff changeset
157 quint8 gender;
d10a6be4d99e Clean unnecessary code
Teemu Piippo <teemu@hecknology.net>
parents: 56
diff changeset
158 quint8 handicap;
d10a6be4d99e Clean unnecessary code
Teemu Piippo <teemu@hecknology.net>
parents: 56
diff changeset
159 quint8 unlagged;
d10a6be4d99e Clean unnecessary code
Teemu Piippo <teemu@hecknology.net>
parents: 56
diff changeset
160 quint8 respawnOnFire;
d10a6be4d99e Clean unnecessary code
Teemu Piippo <teemu@hecknology.net>
parents: 56
diff changeset
161 quint8 ticsPerUpdate;
d10a6be4d99e Clean unnecessary code
Teemu Piippo <teemu@hecknology.net>
parents: 56
diff changeset
162 quint8 connectionType;
64
c55e46b7ddeb Read the colorset value recent Zandronum versions add into userinfo
Teemu Piippo <teemu@hecknology.net>
parents: 63
diff changeset
163 quint8 colorset;
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
164 };
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
165
51
5e4bd3b212ce Fixed the demo not loading properly when the user is prompted for the binary path
Teemu Piippo <tsapii@utu.fi>
parents: 48
diff changeset
166 //
5e4bd3b212ce Fixed the demo not loading properly when the user is prompted for the binary path
Teemu Piippo <tsapii@utu.fi>
parents: 48
diff changeset
167 // -------------------------------------------------------------------------------------------------
5e4bd3b212ce Fixed the demo not loading properly when the user is prompted for the binary path
Teemu Piippo <tsapii@utu.fi>
parents: 48
diff changeset
168 //
5e4bd3b212ce Fixed the demo not loading properly when the user is prompted for the binary path
Teemu Piippo <tsapii@utu.fi>
parents: 48
diff changeset
169
38
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
170 struct DemoHeaders
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
171 {
63
d10a6be4d99e Clean unnecessary code
Teemu Piippo <teemu@hecknology.net>
parents: 56
diff changeset
172 quint8 length;
d10a6be4d99e Clean unnecessary code
Teemu Piippo <teemu@hecknology.net>
parents: 56
diff changeset
173 quint8 version;
d10a6be4d99e Clean unnecessary code
Teemu Piippo <teemu@hecknology.net>
parents: 56
diff changeset
174 quint8 userInfo;
d10a6be4d99e Clean unnecessary code
Teemu Piippo <teemu@hecknology.net>
parents: 56
diff changeset
175 quint8 bodyStart;
d10a6be4d99e Clean unnecessary code
Teemu Piippo <teemu@hecknology.net>
parents: 56
diff changeset
176 quint8 wads;
38
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
177 };
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
178
51
5e4bd3b212ce Fixed the demo not loading properly when the user is prompted for the binary path
Teemu Piippo <tsapii@utu.fi>
parents: 48
diff changeset
179 //
5e4bd3b212ce Fixed the demo not loading properly when the user is prompted for the binary path
Teemu Piippo <tsapii@utu.fi>
parents: 48
diff changeset
180 // -------------------------------------------------------------------------------------------------
5e4bd3b212ce Fixed the demo not loading properly when the user is prompted for the binary path
Teemu Piippo <tsapii@utu.fi>
parents: 48
diff changeset
181 //
5e4bd3b212ce Fixed the demo not loading properly when the user is prompted for the binary path
Teemu Piippo <tsapii@utu.fi>
parents: 48
diff changeset
182
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
183 int launchDemo (QString path)
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
184 {
18
6bf57b4f42cd Replaced the Bytestream class with QDataStream
Teemu Piippo <crimsondusk64@gmail.com>
parents: 17
diff changeset
185 QFile f (path);
41
e985ebb67fdd Removed trailing tabs
Teemu Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
186
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
187 if (not f.open (QIODevice::ReadOnly))
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
188 {
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
189 error (tr ("Couldn't open '%1' for reading: %2").arg (path).arg (strerror (errno)));
6
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
190 return 1;
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
191 }
41
e985ebb67fdd Removed trailing tabs
Teemu Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
192
18
6bf57b4f42cd Replaced the Bytestream class with QDataStream
Teemu Piippo <crimsondusk64@gmail.com>
parents: 17
diff changeset
193 QDataStream stream (&f);
6bf57b4f42cd Replaced the Bytestream class with QDataStream
Teemu Piippo <crimsondusk64@gmail.com>
parents: 17
diff changeset
194 stream.setByteOrder (QDataStream::LittleEndian);
41
e985ebb67fdd Removed trailing tabs
Teemu Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
195
38
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
196 DemoHeaders headers;
63
d10a6be4d99e Clean unnecessary code
Teemu Piippo <teemu@hecknology.net>
parents: 56
diff changeset
197 quint32 length;
d10a6be4d99e Clean unnecessary code
Teemu Piippo <teemu@hecknology.net>
parents: 56
diff changeset
198 quint16 zanversionID, numWads;
d10a6be4d99e Clean unnecessary code
Teemu Piippo <teemu@hecknology.net>
parents: 56
diff changeset
199 quint32 longSink;
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
200 QString zanversion;
64
c55e46b7ddeb Read the colorset value recent Zandronum versions add into userinfo
Teemu Piippo <teemu@hecknology.net>
parents: 63
diff changeset
201 QString dateversion = "00000000";
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
202 QStringList wads;
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
203 UserInfo userinfo;
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
204
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
205 // Assume a release build if the build ID not supplied. The demo only got the "ZCLD" signature
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
206 // in the 1.1 release build, 1.1.1 had no testing binaries and the build ID is included in 1.2
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
207 // onward.
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
208 BuildType buildID = ReleaseBuild;
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
209
18
6bf57b4f42cd Replaced the Bytestream class with QDataStream
Teemu Piippo <crimsondusk64@gmail.com>
parents: 17
diff changeset
210 bool ready = false;
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
211
6
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
212 // Check signature
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
213 {
63
d10a6be4d99e Clean unnecessary code
Teemu Piippo <teemu@hecknology.net>
parents: 56
diff changeset
214 quint32 demosignature;
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
215 stream >> demosignature;
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
216
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
217 if (demosignature != makeByteID ('Z', 'C', 'L', 'D'))
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
218 {
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
219 error (tr ("'%1' is not a valid Zandronum demo file!").arg (path));
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
220 return 1;
6
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
221 }
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
222 }
38
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
223
39
2c368cf5cc19 Finally done with the new Zandronum version handling
Teemu Piippo <crimsondusk64@gmail.com>
parents: 38
diff changeset
224 stream >> headers.length;
2c368cf5cc19 Finally done with the new Zandronum version handling
Teemu Piippo <crimsondusk64@gmail.com>
parents: 38
diff changeset
225 stream >> length;
38
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
226
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
227 // The remaining headers are variable and relative to the length header.
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
228 headers.version = headers.length + 1;
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
229 headers.userInfo = headers.length + 3,
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
230 headers.bodyStart = headers.length + 4;
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
231 headers.wads = headers.length + 10;
41
e985ebb67fdd Removed trailing tabs
Teemu Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
232
10
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
233 // Read the demo header and get data
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
234 for (;;)
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
235 {
63
d10a6be4d99e Clean unnecessary code
Teemu Piippo <teemu@hecknology.net>
parents: 56
diff changeset
236 quint8 header;
18
6bf57b4f42cd Replaced the Bytestream class with QDataStream
Teemu Piippo <crimsondusk64@gmail.com>
parents: 17
diff changeset
237 stream >> header;
41
e985ebb67fdd Removed trailing tabs
Teemu Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
238
38
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
239 if (header == headers.bodyStart)
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
240 {
6
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
241 ready = true;
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
242 break;
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
243 }
38
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
244 else if (header == headers.version)
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
245 {
22
2fe0b7e0da7b For some God-knows-why reason, adding operator>> overloads to QDataStream leads into crashes with QFileDialog. Fixed by removing these overloads.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 21
diff changeset
246 stream >> zanversionID;
2fe0b7e0da7b For some God-knows-why reason, adding operator>> overloads to QDataStream leads into crashes with QFileDialog. Fixed by removing these overloads.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 21
diff changeset
247 zanversion = readString (stream);
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
248
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
249 if (not zanversion.startsWith ("1.1-") and not zanversion.startsWith ("1.1.1-"))
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
250 {
63
d10a6be4d99e Clean unnecessary code
Teemu Piippo <teemu@hecknology.net>
parents: 56
diff changeset
251 quint8 a;
22
2fe0b7e0da7b For some God-knows-why reason, adding operator>> overloads to QDataStream leads into crashes with QFileDialog. Fixed by removing these overloads.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 21
diff changeset
252 stream >> a;
2fe0b7e0da7b For some God-knows-why reason, adding operator>> overloads to QDataStream leads into crashes with QFileDialog. Fixed by removing these overloads.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 21
diff changeset
253 buildID = (BuildType) a;
18
6bf57b4f42cd Replaced the Bytestream class with QDataStream
Teemu Piippo <crimsondusk64@gmail.com>
parents: 17
diff changeset
254 }
64
c55e46b7ddeb Read the colorset value recent Zandronum versions add into userinfo
Teemu Piippo <teemu@hecknology.net>
parents: 63
diff changeset
255 if (zanversion.contains("-r"))
c55e46b7ddeb Read the colorset value recent Zandronum versions add into userinfo
Teemu Piippo <teemu@hecknology.net>
parents: 63
diff changeset
256 {
c55e46b7ddeb Read the colorset value recent Zandronum versions add into userinfo
Teemu Piippo <teemu@hecknology.net>
parents: 63
diff changeset
257 dateversion = zanversion.split("-r").last();
c55e46b7ddeb Read the colorset value recent Zandronum versions add into userinfo
Teemu Piippo <teemu@hecknology.net>
parents: 63
diff changeset
258 }
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
259
38
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
260 // The demo wads header accidentally changed in 1.3. :(
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
261 if (zanversion.left(1).toInt() >= 2 or zanversion.startsWith ("1.3"))
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
262 headers.wads = headers.length + 8;
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
263
18
6bf57b4f42cd Replaced the Bytestream class with QDataStream
Teemu Piippo <crimsondusk64@gmail.com>
parents: 17
diff changeset
264 stream >> longSink; // rng seed - we don't need it
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
265 }
38
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
266 else if (header == headers.userInfo)
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
267 {
22
2fe0b7e0da7b For some God-knows-why reason, adding operator>> overloads to QDataStream leads into crashes with QFileDialog. Fixed by removing these overloads.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 21
diff changeset
268 userinfo.netname = readString (stream);
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
269 stream >> userinfo.gender;
64
c55e46b7ddeb Read the colorset value recent Zandronum versions add into userinfo
Teemu Piippo <teemu@hecknology.net>
parents: 63
diff changeset
270 // Zandronum commit 507a744e69c4 added support for colorsets and versions since that
c55e46b7ddeb Read the colorset value recent Zandronum versions add into userinfo
Teemu Piippo <teemu@hecknology.net>
parents: 63
diff changeset
271 // write a byte for the colorset in the userinfo.
c55e46b7ddeb Read the colorset value recent Zandronum versions add into userinfo
Teemu Piippo <teemu@hecknology.net>
parents: 63
diff changeset
272 if (dateversion >= "210307-0319")
c55e46b7ddeb Read the colorset value recent Zandronum versions add into userinfo
Teemu Piippo <teemu@hecknology.net>
parents: 63
diff changeset
273 {
c55e46b7ddeb Read the colorset value recent Zandronum versions add into userinfo
Teemu Piippo <teemu@hecknology.net>
parents: 63
diff changeset
274 stream >> userinfo.colorset;
c55e46b7ddeb Read the colorset value recent Zandronum versions add into userinfo
Teemu Piippo <teemu@hecknology.net>
parents: 63
diff changeset
275 }
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
276 stream >> userinfo.color;
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
277 stream >> userinfo.aimdist;
22
2fe0b7e0da7b For some God-knows-why reason, adding operator>> overloads to QDataStream leads into crashes with QFileDialog. Fixed by removing these overloads.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 21
diff changeset
278 userinfo.skin = readString (stream);
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
279 stream >> userinfo.railcolor;
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
280 stream >> userinfo.handicap;
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
281 stream >> userinfo.unlagged;
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
282 stream >> userinfo.respawnOnFire;
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
283 stream >> userinfo.ticsPerUpdate;
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
284 stream >> userinfo.connectionType;
22
2fe0b7e0da7b For some God-knows-why reason, adding operator>> overloads to QDataStream leads into crashes with QFileDialog. Fixed by removing these overloads.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 21
diff changeset
285 userinfo.className = readString (stream);
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
286 }
38
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
287 else if (header == headers.wads)
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
288 {
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
289 QString sink;
18
6bf57b4f42cd Replaced the Bytestream class with QDataStream
Teemu Piippo <crimsondusk64@gmail.com>
parents: 17
diff changeset
290 stream >> numWads;
41
e985ebb67fdd Removed trailing tabs
Teemu Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
291
63
d10a6be4d99e Clean unnecessary code
Teemu Piippo <teemu@hecknology.net>
parents: 56
diff changeset
292 for (quint8 i = 0; i < numWads; ++i)
38
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
293 {
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
294 QString wad = readString (stream);
6
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
295 wads << wad;
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
296 }
41
e985ebb67fdd Removed trailing tabs
Teemu Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
297
38
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
298 // The demo has two checksum strings. We're not interested in them, though.
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
299 (sink = readString (stream)) = readString (stream);
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
300 }
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
301 else
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
302 {
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
303 error (tr ("Unknown header %1!\n").arg (int (header)));
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
304 return 1;
6
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
305 }
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
306 }
10
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
307
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
308 if (not ready)
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
309 {
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
310 error (tr ("Incomplete demo header in '%s'!").arg (path));
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
311 return 1;
10
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
312 }
38
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
313
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
314 ZandronumVersion version = findVersion (zanversion);
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
315
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
316 if (version.name.isNull())
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
317 {
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
318 QDialog* prompt = new UnknownVersionPrompt (path, zanversion, (buildID == ReleaseBuild));
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
319
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
320 if (not prompt->exec())
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
321 return 1;
51
5e4bd3b212ce Fixed the demo not loading properly when the user is prompted for the binary path
Teemu Piippo <tsapii@utu.fi>
parents: 48
diff changeset
322
5e4bd3b212ce Fixed the demo not loading properly when the user is prompted for the binary path
Teemu Piippo <tsapii@utu.fi>
parents: 48
diff changeset
323 version = findVersion (zanversion);
5e4bd3b212ce Fixed the demo not loading properly when the user is prompted for the binary path
Teemu Piippo <tsapii@utu.fi>
parents: 48
diff changeset
324 assert (not version.name.isNull());
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
325 }
41
e985ebb67fdd Removed trailing tabs
Teemu Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
326
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
327 QString iwadpath;
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
328 QStringList pwadpaths;
56
bdbbde5f754e Added the ability to automatically look up wad paths from other sources (for now just Doomseeker's configuration). By default, ZCinema will automatically do such a lookup if it fails to find a WAD needed for demo playback. This can also be invoked manually in the config prompt.
Teemu Piippo <tsapii@utu.fi>
parents: 51
diff changeset
329 bool doneAssimilation = false;
41
e985ebb67fdd Removed trailing tabs
Teemu Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
330
6
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
331 // Find the WADs
48
e121ea9dba93 Now C++03 compatible
Teemu Piippo <crimsondusk64@gmail.com>
parents: 46
diff changeset
332 for (int i = 0; i < wads.size(); ++i)
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
333 {
48
e121ea9dba93 Now C++03 compatible
Teemu Piippo <crimsondusk64@gmail.com>
parents: 46
diff changeset
334 const QString& wad = wads[i];
56
bdbbde5f754e Added the ability to automatically look up wad paths from other sources (for now just Doomseeker's configuration). By default, ZCinema will automatically do such a lookup if it fails to find a WAD needed for demo playback. This can also be invoked manually in the config prompt.
Teemu Piippo <tsapii@utu.fi>
parents: 51
diff changeset
335 QString path = findWad (wad);
bdbbde5f754e Added the ability to automatically look up wad paths from other sources (for now just Doomseeker's configuration). By default, ZCinema will automatically do such a lookup if it fails to find a WAD needed for demo playback. This can also be invoked manually in the config prompt.
Teemu Piippo <tsapii@utu.fi>
parents: 51
diff changeset
336
bdbbde5f754e Added the ability to automatically look up wad paths from other sources (for now just Doomseeker's configuration). By default, ZCinema will automatically do such a lookup if it fails to find a WAD needed for demo playback. This can also be invoked manually in the config prompt.
Teemu Piippo <tsapii@utu.fi>
parents: 51
diff changeset
337 if (path.isEmpty() and not doneAssimilation and Config::get ("autoassimilate").toBool())
bdbbde5f754e Added the ability to automatically look up wad paths from other sources (for now just Doomseeker's configuration). By default, ZCinema will automatically do such a lookup if it fails to find a WAD needed for demo playback. This can also be invoked manually in the config prompt.
Teemu Piippo <tsapii@utu.fi>
parents: 51
diff changeset
338 {
bdbbde5f754e Added the ability to automatically look up wad paths from other sources (for now just Doomseeker's configuration). By default, ZCinema will automatically do such a lookup if it fails to find a WAD needed for demo playback. This can also be invoked manually in the config prompt.
Teemu Piippo <tsapii@utu.fi>
parents: 51
diff changeset
339 QStringList wadpaths = Config::get ("wadpaths").toStringList();
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
340
56
bdbbde5f754e Added the ability to automatically look up wad paths from other sources (for now just Doomseeker's configuration). By default, ZCinema will automatically do such a lookup if it fails to find a WAD needed for demo playback. This can also be invoked manually in the config prompt.
Teemu Piippo <tsapii@utu.fi>
parents: 51
diff changeset
341 // If there are no wad paths, try assimilate from other sources.
bdbbde5f754e Added the ability to automatically look up wad paths from other sources (for now just Doomseeker's configuration). By default, ZCinema will automatically do such a lookup if it fails to find a WAD needed for demo playback. This can also be invoked manually in the config prompt.
Teemu Piippo <tsapii@utu.fi>
parents: 51
diff changeset
342 assimilateWadPaths (wadpaths);
bdbbde5f754e Added the ability to automatically look up wad paths from other sources (for now just Doomseeker's configuration). By default, ZCinema will automatically do such a lookup if it fails to find a WAD needed for demo playback. This can also be invoked manually in the config prompt.
Teemu Piippo <tsapii@utu.fi>
parents: 51
diff changeset
343 Config::set ("wadpaths", wadpaths);
bdbbde5f754e Added the ability to automatically look up wad paths from other sources (for now just Doomseeker's configuration). By default, ZCinema will automatically do such a lookup if it fails to find a WAD needed for demo playback. This can also be invoked manually in the config prompt.
Teemu Piippo <tsapii@utu.fi>
parents: 51
diff changeset
344
bdbbde5f754e Added the ability to automatically look up wad paths from other sources (for now just Doomseeker's configuration). By default, ZCinema will automatically do such a lookup if it fails to find a WAD needed for demo playback. This can also be invoked manually in the config prompt.
Teemu Piippo <tsapii@utu.fi>
parents: 51
diff changeset
345 // Try find the wad again
bdbbde5f754e Added the ability to automatically look up wad paths from other sources (for now just Doomseeker's configuration). By default, ZCinema will automatically do such a lookup if it fails to find a WAD needed for demo playback. This can also be invoked manually in the config prompt.
Teemu Piippo <tsapii@utu.fi>
parents: 51
diff changeset
346 path = findWad (wad);
bdbbde5f754e Added the ability to automatically look up wad paths from other sources (for now just Doomseeker's configuration). By default, ZCinema will automatically do such a lookup if it fails to find a WAD needed for demo playback. This can also be invoked manually in the config prompt.
Teemu Piippo <tsapii@utu.fi>
parents: 51
diff changeset
347 }
41
e985ebb67fdd Removed trailing tabs
Teemu Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
348
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
349 if (path.isEmpty())
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
350 {
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
351 error (tr ("Couldn't find %1!").arg (wad));
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
352 return 1;
6
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
353 }
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
354
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
355 if (&wad == &wads.first())
6
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
356 iwadpath = path;
10
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
357 else
6
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
358 pwadpaths << path;
8
e8f645d9f28f Added a prompt for demo information
Teemu Piippo <crimsondusk64@gmail.com>
parents: 6
diff changeset
359 }
41
e985ebb67fdd Removed trailing tabs
Teemu Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
360
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
361 if (not Config::get ("noprompt").toBool())
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
362 {
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
363 QString pwadtext;
41
e985ebb67fdd Removed trailing tabs
Teemu Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
364
48
e121ea9dba93 Now C++03 compatible
Teemu Piippo <crimsondusk64@gmail.com>
parents: 46
diff changeset
365 for (int i = 0; i < wads.size(); ++i)
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
366 {
48
e121ea9dba93 Now C++03 compatible
Teemu Piippo <crimsondusk64@gmail.com>
parents: 46
diff changeset
367 if (i == 0)
10
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
368 continue; // skip the IWAD
41
e985ebb67fdd Removed trailing tabs
Teemu Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
369
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
370 if (not pwadtext.isEmpty())
8
e8f645d9f28f Added a prompt for demo information
Teemu Piippo <crimsondusk64@gmail.com>
parents: 6
diff changeset
371 pwadtext += "<br />";
41
e985ebb67fdd Removed trailing tabs
Teemu Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
372
48
e121ea9dba93 Now C++03 compatible
Teemu Piippo <crimsondusk64@gmail.com>
parents: 46
diff changeset
373 pwadtext += wads[i];
8
e8f645d9f28f Added a prompt for demo information
Teemu Piippo <crimsondusk64@gmail.com>
parents: 6
diff changeset
374 }
41
e985ebb67fdd Removed trailing tabs
Teemu Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
375
8
e8f645d9f28f Added a prompt for demo information
Teemu Piippo <crimsondusk64@gmail.com>
parents: 6
diff changeset
376 QDialog* dlg = new QDialog;
e8f645d9f28f Added a prompt for demo information
Teemu Piippo <crimsondusk64@gmail.com>
parents: 6
diff changeset
377 Ui_DemoPrompt ui;
10
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
378 ui.setupUi (dlg);
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
379 ui.demoNameLabel->setText (basename (path));
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
380 ui.demoRecorder->setText (uncolorize (userinfo.netname));
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
381 ui.versionLabel->setText (zanversion);
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
382 ui.iwadLabel->setText (wads[0]);
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
383 ui.pwadsLabel->setText (pwadtext);
26
9aab482c9125 When launched with no parameters, prompt the user for a demo
Teemu Piippo <crimsondusk64@gmail.com>
parents: 24
diff changeset
384 dlg->setWindowTitle (versionSignature());
41
e985ebb67fdd Removed trailing tabs
Teemu Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
385
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
386 if (not dlg->exec())
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
387 return 0;
6
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
388 }
10
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
389
36
b8fa9171be6e Converted to CMake
Teemu Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
390 QStringList cmdlineList;
b8fa9171be6e Converted to CMake
Teemu Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
391 cmdlineList << "-playdemo" << path << "-iwad" << iwadpath;
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
392
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
393 if (pwadpaths.size() > 0)
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
394 cmdlineList << "-file" << pwadpaths;
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
395
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 36
diff changeset
396 // print ("Executing: %1 %2\n", binarypath, cmdlineList.join (" "));
6
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
397 QProcess* proc = new QProcess;
38
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
398 proc->start (version.binaryPath, cmdlineList);
10
bc1414343e19 Overhauled the way versions are handled, it's all kept dynamically now.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 8
diff changeset
399 proc->waitForFinished (-1);
6
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
400 return 0;
36
b8fa9171be6e Converted to CMake
Teemu Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
401 }

mercurial