forked from PrimeDecomp/PrimeRemasterStructs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NModConFormat.bt
163 lines (140 loc) · 3.41 KB
/
NModConFormat.bt
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
162
163
#ifndef _NMODCONFORMAT
#define _NMODCONFORMAT
#include "CCollisionTree.bt"
#include "CColor4f.bt"
#include "CRenderOctree.bt"
#include "SAtlasLookup.bt"
struct ModConHeader {
uint32 unk;
};
struct ModConVisualData {
uint32 count;
if (count > 0) {
CGuid modelId[count];
}
uint32 count2;
if (count2 > 0) {
CGuid ids2[count2];
}
uint32 colorCount;
if (colorCount > 0) {
CColor4f color[colorCount];
}
uint32 transformCount;
if (transformCount > 0) {
CTransform4f xf[transformCount];
}
uint32 objectTransformCount;
if (objectTransformCount > 0) {
struct {
CGuid id;
CTransform4f xf;
} objectXf[objectTransformCount];
}
uint32 byteCount;
if (byteCount > 0) {
byte bytes[byteCount];
}
uint32 shortCount;
if (shortCount > 0) {
uint16 shorts[shortCount];
}
uint32 shortCount2;
if (shortCount2 > 0) {
uint16 shorts2[shortCount2];
}
uint32 byteCount2;
if (byteCount2 > 0) {
byte bytes2[byteCount2];
}
uint32 byteCount3;
if (byteCount3 > 0) {
byte bytes3[byteCount3];
}
uint32 atlasLookupCount1;
if (atlasLookupCount1 > 0) {
SAtlasLookup atlasLookup1[atlasLookupCount1];
}
uint32 atlasLookupCount2;
if (atlasLookupCount2 > 0) {
SAtlasLookup atlasLookup2[atlasLookupCount2];
}
uint32 renderOctreeFlags;
if (renderOctreeFlags != 0) {
CRenderOctree renderOctree;
}
};
typedef struct {
uint32 unk1;
uint32 intCount;
if (intCount) {
uint32 ints[intCount];
}
uint32 shortCount;
if (shortCount) {
uint16 shorts[shortCount];
}
} SModelVertexBlendData <optimize = false>;
typedef struct {
uint32 unkDataCount;
if (unkDataCount) {
byte unkData[unkDataCount];
}
uint32 unkIntCount;
if (unkIntCount) {
uint32 unkInts[unkIntCount];
}
uint32 modelVertexBlendDataCount;
if (modelVertexBlendDataCount) {
SModelVertexBlendData modelVertexBlendData[modelVertexBlendDataCount];
}
} SNodeVertexBlendData <optimize = false>;
struct ModConVertexBlendData {
uint32 vertexBlendDataCount;
if (vertexBlendDataCount) {
SNodeVertexBlendData vertexBlendData[vertexBlendData];
}
};
struct ModConChunk;
typedef struct {
if (ReadString(FTell(), 4) == "PEEK") {
struct {
FourCC id;
local uint64 size <hidden = true> = 0;
} desc;
local uint64 start <hidden = true> = FTell();
} else {
ChunkDescriptor desc;
local uint64 start <hidden = true> = FTell();
switch (desc.id) {
case "MCHD":
ModConHeader data;
break;
case "MCVD":
ModConVisualData data;
break;
case "MCCD":
CCollisionTree data(desc.size, kCOL_AABox);
break;
case "MCVB":
ModConVertexBlendData data;
break;
default:
if (desc.size > 0) {
byte data[desc.size];
}
break;
}
}
FSeek(start + desc.size);
} ModConChunk <
name=(Str("%s chunk", desc.id)),
comment=(SizeComment(desc.size))
>;
struct CModConData(uint64 size) {
local uint64 start <hidden = true> = FTell();
while (FTell() < start + size) {
ModConChunk data;
}
};
#endif