This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
MCG.bt
82 lines (70 loc) · 1.95 KB
/
MCG.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
//------------------------------------------------
//--- 010 Editor v9.0.2 Binary Template
//
// File: MCG.bt
// Authors: Meowmaritus, TKGP
// Version:
// Purpose:
// Category: Dantelion
// File Mask: *.mcg
// ID Bytes:
// History:
//------------------------------------------------
#include "Util.bt"
LittleEndian();
if (ReadInt() == 0x1000000)
BigEndian();
//------------------------------------------------
typedef struct {
int unk00; Assert(unk00 == 1);
int unk04; // unk04, unk18, unk1C may just be uninitialized memory in DeS
int nodeCount;
int nodesOffset <format=hex>;
int edgeCount;
int edgesOffset <format=hex>;
int unk18;
int unk1C;
} Header <bgcolor=cLtRed>;
typedef struct {
int indexCount;
Vector3 position;
int nodeIndicesOffset <format=hex>;
int edgeIndicesOffset <format=hex>;
int unk18;
int unk1C;
if (indexCount > 0) {
local quad pos <hidden=true> = FTell();
FSeek(nodeIndicesOffset);
int nodeIndices[indexCount] <bgcolor=cGreen>;
FSeek(edgeIndicesOffset);
int edgeIndices[indexCount] <bgcolor=cGreen>;
FSeek(pos);
}
} Node <bgcolor=cLtGreen, optimize=false>;
typedef struct {
int endpointIndexA;
int indexCountA;
int indicesOffsetA;
int endpointIndexB;
int indexCountB;
int indicesOffsetB;
int mcpRoomIndex;
uint mapID <format=hex>;
float unk20;
local quad pos <hidden=true> = FTell();
FSeek(indicesOffsetA);
int indicesA[indexCountA] <bgcolor=cDkAqua>;
FSeek(indicesOffsetB);
int indicesB[indexCountB] <bgcolor=cDkAqua>;
FSeek(pos);
} Edge <bgcolor=cAqua, optimize=false>;
//------------------------------------------------
Header header;
if (header.nodeCount > 0) {
FSeek(header.nodesOffset);
struct { Node nodes[header.nodeCount]; } nodes;
}
if (header.edgeCount > 0) {
FSeek(header.edgesOffset);
struct { Edge edges[header.edgeCount]; } edges;
}