195 DemoHeaders headers; |
196 DemoHeaders headers; |
196 quint32 length; |
197 quint32 length; |
197 quint16 zanversionID, numWads; |
198 quint16 zanversionID, numWads; |
198 quint32 longSink; |
199 quint32 longSink; |
199 QString zanversion; |
200 QString zanversion; |
|
201 QString dateversion = "00000000"; |
200 QStringList wads; |
202 QStringList wads; |
201 UserInfo userinfo; |
203 UserInfo userinfo; |
202 |
204 |
203 // Assume a release build if the build ID not supplied. The demo only got the "ZCLD" signature |
205 // Assume a release build if the build ID not supplied. The demo only got the "ZCLD" signature |
204 // in the 1.1 release build, 1.1.1 had no testing binaries and the build ID is included in 1.2 |
206 // in the 1.1 release build, 1.1.1 had no testing binaries and the build ID is included in 1.2 |
248 { |
250 { |
249 quint8 a; |
251 quint8 a; |
250 stream >> a; |
252 stream >> a; |
251 buildID = (BuildType) a; |
253 buildID = (BuildType) a; |
252 } |
254 } |
|
255 if (zanversion.contains("-r")) |
|
256 { |
|
257 dateversion = zanversion.split("-r").last(); |
|
258 } |
253 |
259 |
254 // The demo wads header accidentally changed in 1.3. :( |
260 // The demo wads header accidentally changed in 1.3. :( |
255 if (zanversion.left(1).toInt() >= 2 or zanversion.startsWith ("1.3")) |
261 if (zanversion.left(1).toInt() >= 2 or zanversion.startsWith ("1.3")) |
256 headers.wads = headers.length + 8; |
262 headers.wads = headers.length + 8; |
257 |
263 |
259 } |
265 } |
260 else if (header == headers.userInfo) |
266 else if (header == headers.userInfo) |
261 { |
267 { |
262 userinfo.netname = readString (stream); |
268 userinfo.netname = readString (stream); |
263 stream >> userinfo.gender; |
269 stream >> userinfo.gender; |
|
270 // Zandronum commit 507a744e69c4 added support for colorsets and versions since that |
|
271 // write a byte for the colorset in the userinfo. |
|
272 if (dateversion >= "210307-0319") |
|
273 { |
|
274 stream >> userinfo.colorset; |
|
275 } |
264 stream >> userinfo.color; |
276 stream >> userinfo.color; |
265 stream >> userinfo.aimdist; |
277 stream >> userinfo.aimdist; |
266 userinfo.skin = readString (stream); |
278 userinfo.skin = readString (stream); |
267 stream >> userinfo.railcolor; |
279 stream >> userinfo.railcolor; |
268 stream >> userinfo.handicap; |
280 stream >> userinfo.handicap; |