forked from kapuragu/FoxEngineTemplates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgpfp_entry.bt
59 lines (50 loc) · 1.65 KB
/
gpfp_entry.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
// GPFP Entry - GeoPathPack Entry
// By RLC - inspired by other FOX templates by the researchers of Modders' Heaven!
// https://metalgearmodding.fandom.com/wiki/GPFP
// Special thanks to Joey for the flag parsing parts and the original header template!
LittleEndian(); // only entry so no easy way to get endianneess
struct Entry
{
uint flag0 : 8; // usually 72
uint flag1 : 8; // usually 0
uint flag2 : 8; // usually 128
uint edgeCount : 8;
FSkip(0x0C);
uint64 u1; // a long, according to ps3 big endian files. probably flags?
uint name; // With gimmicks, it has to be the gimmick instance name as StrCode32 hash, ie <_n0000|srt_>. If there's more than one path for one instance, the hash is the same, but with the seventh of the eight bits shifted by 2
uint offsetToNodes; // Offset from start of the entry to nodes
struct Edge
{
uint edgeFlag0 : 4;
uint edgeFlag1 : 4;
uint edgeFlag2 : 4;
uint edgeFlag3 : 4;
uint edgeFlag4 : 4;
uint edgeFlag5 : 4;
uint edgeFlag6 : 4;
uint edgeFlag7 : 4;
ushort nodeA;
ushort nodeB;
} edge [edgeCount] <bgcolor=0xB9E7CA, optimize=true>;
// Special thanks to BobDoleOwndU and OldBanana!
if (FTell() % 0x10 != 0)
{
FSkip(0x10 - (FTell() % 0x10));
}
FSkip(0x10);
struct Node
{
float x;
float y;
float z;
uint nodeFlag0 : 4;
uint nodeFlag1 : 4;
uint nodeFlag2 : 4;
uint nodeFlag3 : 4;
uint nodeFlag4 : 4;
uint nodeFlag5 : 4;
uint nodeFlag6 : 4;
uint nodeFlag7 : 4;
} node[edgeCount+1] <bgcolor=0x8ADEF3, optimize=true>;
// There's probably a better way to get the node count, like the highest edge index in a node entry + 1
} entry <bgcolor=0x8694EB, optimize=true>;