commonlib/types.h

Sun, 14 Nov 2021 21:42:23 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Sun, 14 Nov 2021 21:42:23 +0200
changeset 61
56c52c10e444
parent 48
e121ea9dba93
child 63
d10a6be4d99e
permissions
-rw-r--r--

Fix build error involving QDataStream

13
9bdddd2ccde6 now with 3691% extra legalese!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 6
diff changeset
1 /*
30
6b82f6a3ad53 renamed the project to ZCinema
Teemu Piippo <crimsondusk64@gmail.com>
parents: 21
diff changeset
2 * ZCinema: Zandronum demo launcher
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
3 * Copyright (C) 2013-2015 Teemu Piippo
13
9bdddd2ccde6 now with 3691% extra legalese!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 6
diff changeset
4 *
9bdddd2ccde6 now with 3691% extra legalese!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 6
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: 6
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: 6
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: 6
diff changeset
8 * (at your option) any later version.
9bdddd2ccde6 now with 3691% extra legalese!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 6
diff changeset
9 *
9bdddd2ccde6 now with 3691% extra legalese!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 6
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: 6
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: 6
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9bdddd2ccde6 now with 3691% extra legalese!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 6
diff changeset
13 * GNU General Public License for more details.
9bdddd2ccde6 now with 3691% extra legalese!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 6
diff changeset
14 *
9bdddd2ccde6 now with 3691% extra legalese!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 6
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: 6
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: 6
diff changeset
17 */
9bdddd2ccde6 now with 3691% extra legalese!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 6
diff changeset
18
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
19 #pragma once
61
56c52c10e444 Fix build error involving QDataStream
Teemu Piippo <teemu@hecknology.net>
parents: 48
diff changeset
20 #include <QDataStream>
0
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
21 #include <QString>
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
22 #include <QList>
3
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 1
diff changeset
23 #include <QVariant>
0
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
24
6
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
25 typedef qint8 int8;
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
26 typedef qint16 int16;
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
27 typedef qint32 int32;
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
28 typedef qint64 int64;
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
29 typedef quint8 uint8;
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
30 typedef quint16 uint16;
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
31 typedef quint32 uint32;
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
32 typedef quint64 uint64;
67b6ef6917ba Now capable of actually launching demos
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
33
37
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
34 struct ZandronumVersion
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
35 {
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
36 ZandronumVersion (QString name, bool isRelease, QString binaryPath) :
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
37 name (name),
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
38 binaryPath (binaryPath),
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
39 isRelease (isRelease) {}
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
40
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
41 ZandronumVersion() :
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
42 isRelease (false) {}
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
43
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
44 QString name;
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
45 QString binaryPath;
c82a86ea87be Major rework, lots of internal maintenance, version editor removed
Teemu Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
46 bool isRelease;
0
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
47 };
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
48
38
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
49 inline QDataStream& operator<< (QDataStream& out, const ZandronumVersion& version)
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
50 {
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
51 return (out << version.name << version.binaryPath << version.isRelease);
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
52 }
0
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
53
38
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
54 inline QDataStream& operator>> (QDataStream& in, ZandronumVersion& version)
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
55 {
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
56 return (in >> version.name >> version.binaryPath >> version.isRelease);
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
57 }
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
58
db677d321cf4 Fix demo launching
Teemu Piippo <crimsondusk64@gmail.com>
parents: 37
diff changeset
59 Q_DECLARE_METATYPE (ZandronumVersion)

mercurial