/
id1map_datatypes.h
161 lines (137 loc) · 4.35 KB
/
id1map_datatypes.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
/** @file id1map_datatypes.h id Tech 1 map data types.
*
* @ingroup wadmapconverter
*
* @authors Copyright © 2007-2013 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
*
* <small>This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. This program is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details. You should have received a copy of the GNU
* General Public License along with this program; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA</small>
*/
#ifndef WADMAPCONVERTER_ID1MAP_DATATYPES_H
#define WADMAPCONVERTER_ID1MAP_DATATYPES_H
#include "doomsday.h"
#include "dd_types.h"
#include "id1map.h"
#include <QVector>
/// Sizes of the map data structures in the arrived map formats (in bytes).
#define SIZEOF_64VERTEX (4 * 2)
#define SIZEOF_VERTEX (2 * 2)
#define SIZEOF_64THING (2 * 7)
#define SIZEOF_XTHING (2 * 7 + 1 * 6)
#define SIZEOF_THING (2 * 5)
#define SIZEOF_XLINEDEF (2 * 5 + 1 * 6)
#define SIZEOF_64LINEDEF (2 * 6 + 1 * 4)
#define SIZEOF_LINEDEF (2 * 7)
#define SIZEOF_64SIDEDEF (2 * 6)
#define SIZEOF_SIDEDEF (2 * 3 + 8 * 3)
#define SIZEOF_64SECTOR (2 * 12)
#define SIZEOF_SECTOR (2 * 5 + 8 * 2)
#define SIZEOF_LIGHT (1 * 6)
struct mside_t
{
int index;
int16_t offset[2];
Id1Map::MaterialId topMaterial;
Id1Map::MaterialId bottomMaterial;
Id1Map::MaterialId middleMaterial;
int sector;
};
/// Line sides.
#define RIGHT 0
#define LEFT 1
/**
* @defgroup lineAnalysisFlags Line Analysis flags
*/
///@{
#define LAF_POLYOBJ 0x1 ///< Line defines a polyobj segment.
///@}
#define PO_LINE_START (1) ///< Polyobj line start special.
#define PO_LINE_EXPLICIT (5)
#define SEQTYPE_NUMSEQ (10)
struct mline_t
{
int index;
int v[2];
int sides[2];
int16_t flags; ///< MF_* flags.
// Analysis data:
int16_t aFlags;
// DOOM format members:
int16_t dType;
int16_t dTag;
// Hexen format members:
int8_t xType;
int8_t xArgs[5];
// DOOM64 format members:
int8_t d64drawFlags;
int8_t d64texFlags;
int8_t d64type;
int8_t d64useType;
int16_t d64tag;
int ddFlags;
uint validCount; ///< Used for polyobj line collection.
};
struct msector_t
{
int index;
int16_t floorHeight;
int16_t ceilHeight;
int16_t lightLevel;
int16_t type;
int16_t tag;
Id1Map::MaterialId floorMaterial;
Id1Map::MaterialId ceilMaterial;
// DOOM64 format members:
int16_t d64flags;
uint16_t d64floorColor;
uint16_t d64ceilingColor;
uint16_t d64unknownColor;
uint16_t d64wallTopColor;
uint16_t d64wallBottomColor;
};
// Thing DoomEdNums for polyobj anchors/spawn spots.
#define PO_ANCHOR_DOOMEDNUM (3000)
#define PO_SPAWN_DOOMEDNUM (3001)
#define PO_SPAWNCRUSH_DOOMEDNUM (3002)
struct mthing_t
{
int index;
int16_t origin[3];
angle_t angle;
int16_t doomEdNum;
int32_t flags;
int32_t skillModes;
// Hexen format members:
int16_t xTID;
int8_t xSpecial;
int8_t xArgs[5];
// DOOM64 format members:
int16_t d64TID;
};
struct mpolyobj_t
{
typedef QVector<int> LineIndices;
int index;
LineIndices lineIndices;
int tag;
int seqType;
int16_t anchor[2];
};
struct surfacetint_t
{
int index;
float rgb[3];
int8_t xx[3];
};
#endif // WADMAPCONVERTER_ID1MAP_DATATYPES_H