launcher/demo.cpp

changeset 51
5e4bd3b212ce
parent 48
e121ea9dba93
child 56
bdbbde5f754e
equal deleted inserted replaced
50:5dc8b48f80b3 51:5e4bd3b212ce
19 #include <QFile> 19 #include <QFile>
20 #include <QDataStream> 20 #include <QDataStream>
21 #include <QMessageBox> 21 #include <QMessageBox>
22 #include <QProcess> 22 #include <QProcess>
23 #include <errno.h> 23 #include <errno.h>
24 #include <assert.h>
24 #include <commonlib/misc.h> 25 #include <commonlib/misc.h>
25 #include <commonlib/config.h> 26 #include <commonlib/config.h>
26 #include <commonlib/version.h> 27 #include <commonlib/version.h>
27 #include "demo.h" 28 #include "demo.h"
28 #include "prompts.h" 29 #include "prompts.h"
163 uint8 respawnOnFire; 164 uint8 respawnOnFire;
164 uint8 ticsPerUpdate; 165 uint8 ticsPerUpdate;
165 uint8 connectionType; 166 uint8 connectionType;
166 }; 167 };
167 168
169 //
170 // -------------------------------------------------------------------------------------------------
171 //
172
168 struct DemoHeaders 173 struct DemoHeaders
169 { 174 {
170 uint8 length; 175 uint8 length;
171 uint8 version; 176 uint8 version;
172 uint8 userInfo; 177 uint8 userInfo;
173 uint8 bodyStart; 178 uint8 bodyStart;
174 uint8 wads; 179 uint8 wads;
175 }; 180 };
181
182 //
183 // -------------------------------------------------------------------------------------------------
184 //
176 185
177 int launchDemo (QString path) 186 int launchDemo (QString path)
178 { 187 {
179 QFile f (path); 188 QFile f (path);
180 189
300 { 309 {
301 QDialog* prompt = new UnknownVersionPrompt (path, zanversion, (buildID == ReleaseBuild)); 310 QDialog* prompt = new UnknownVersionPrompt (path, zanversion, (buildID == ReleaseBuild));
302 311
303 if (not prompt->exec()) 312 if (not prompt->exec())
304 return 1; 313 return 1;
314
315 version = findVersion (zanversion);
316 assert (not version.name.isNull());
305 } 317 }
306 318
307 QString iwadpath; 319 QString iwadpath;
308 QStringList pwadpaths; 320 QStringList pwadpaths;
309 321

mercurial