-
Notifications
You must be signed in to change notification settings - Fork 0
/
data_types.py
137 lines (115 loc) · 2.57 KB
/
data_types.py
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
# H - uint16, h - int16, I - uint32, i - int32, c - char
class TextureMap:
__slots__ = [
'name',
'flags',
'width',
'height',
'column_dir', # unused
'patch_count',
'patch_maps',
]
class PatchMap:
__slots__ = [
'x_offset',
'y_offset',
'p_name_index',
'step_dir', # unused
'color_map', # unused
]
class TextureHeader:
__slots__ = [
'texture_count',
'texture_offset',
'texture_data_offset',
]
class PatchColumn:
__slots__ = [
'top_delta', # B
'length', # B
'padding_pre', # B - unused
'data', # length x B
'padding_post' # B - unused
]
class PatchHeader:
__slots__ = [
'width', # H
'height', # H
'left_offset', # h
'top_offset', # h
'column_offset' # width x I
]
class Thing:
# 10 bytes
__slots__ = [
'pos', # pos.x, pos.y - 4h
'angle', # 2H
'type', # 2H
'flags' # 2H
]
class Sector:
# 26 bytes = 2h + 2h + 8c + 8c + 2H x 3
__slots__ = [
'floor_height',
'ceil_height',
'floor_texture',
'ceil_texture',
'light_level',
'type',
'tag'
]
class Sidedef:
# 30 bytes = 2h + 2h + 8c + 8c + 8c + 2H
__slots__ = [
'x_offset',
'y_offset',
'upper_texture',
'lower_texture',
'middle_texture',
'sector_id',
]
__slots__ += ['sector']
class Seg:
# 12 bytes = 2h x 6
__slots__ = [
'start_vertex_id',
'end_vertex_id',
'angle',
'linedef_id',
'direction',
'offset',
]
__slots__ += ['start_vertex', 'end_vertex', 'linedef', 'front_sector', 'back_sector']
class Linedef:
# 14 bytes = 2H x 7
__slots__ = [
'start_vertex_id',
'end_vertex_id',
'flags',
'line_type',
'sector_tag',
'front_sidedef_id',
'back_sidedef_id'
]
__slots__ += ['front_sidedef', 'back_sidedef']
class SubSector:
# 4 bytes = 2h + 2h
__slots__ = [
'seg_count',
'first_seg_id'
]
class Node:
# 28 bytes = 2h x 12 + 2H x 2
class BBox:
__slots__ = ['top', 'bottom', 'left', 'right']
__slots__ = [
'x_partition',
'y_partition',
'dx_partition',
'dy_partition',
'bbox', # 8h
'front_child_id',
'back_child_id',
]
def __init__(self):
self.bbox = {'front': self.BBox(), 'back': self.BBox()}