-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathw3-obj-mod-file.ksy
85 lines (85 loc) · 1.58 KB
/
w3-obj-mod-file.ksy
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
meta:
id: w3_obj_mod_file
endian: le
imports:
- w3id
- w3str
params:
- id: use_extended
type: u1
seq:
- id: version
type: u4
- id: default_objects_chunk
type: objects_chunk
- id: custom_objects_chunk
type: objects_chunk
types:
objects_chunk:
seq:
- id: num_object
type: u4
- id: object
type: obj
repeat: expr
repeat-expr: num_object
obj:
seq:
- id: base_id
type: w3id
- id: new_id
type: w3id
- id: num_set
type: num_set
- id: set
type: set
repeat: expr
repeat-expr: num_set.value
num_set:
seq:
- id: num_set
type: u4
if: _root.version >= 3
instances:
value:
value: '_root.version >= 3 ? num_set : 1'
set:
seq:
- id: set_flag
type: u4
if: _root.version >= 3
- id: num_mod
type: u4
- id: mod
type: mod
repeat: expr
repeat-expr: num_mod
mod:
seq:
- id: id
type: w3id
- id: value_type
type: u4
enum: value_types
- id: level_or_variation
type: u4
if: _root.use_extended != 0
- id: data_pointer
type: u4
if: _root.use_extended != 0
- id: value
type:
switch-on: value_type
cases:
value_types::int: u4
value_types::real: f4
value_types::unreal: f4
_: w3str
- id: end_token
type: w3id
enums:
value_types:
0: int
1: real
2: unreal
3: string