-
Notifications
You must be signed in to change notification settings - Fork 0
/
tr7ae_fxanim.bt
189 lines (172 loc) · 4.24 KB
/
tr7ae_fxanim.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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
//------------------------------------------------
//--- 010 Editor v11.0.1 Binary Template
//
// File: tr7ae_fxanim.bt
// Authors: TheIndra
// Version: 1.0
// Purpose: Parsing FX Animation files
// Category: TR7AE
// File Mask: *.dtp
//------------------------------------------------
#include "tr7ae_section.bt"
enum <ushort> CallbackType
{
G2ANIM_VARSOUND_CALLBACK,
G2ANIM_EFFECT_CALLBACK,
G2ANIM_USER_CALLBACK,
G2ANIM_RNDSOUND_CALLBACK
};
typedef struct
{
CallbackType m_typeMask : 2;
uint16 m_disable : 1;
uint16 m_oneShot : 1;
uint16 m_materialMode : 5;
uint16 m_triggerMode : 2;
uint16 m_sectionId : 1;
uint16 m_fxSize : 4;
} FxaInfo;
typedef struct
{
FxaInfo info;
int16 keyframeID;
byte fxID;
byte pad[3] <hidden=true>;
} AnimFxHeader;
enum <ubyte> EffectType
{
NoEffect,
Glow1Seg = 2,
GlowMSeg = 3,
ParticleFX = 5,
RibbonFX = 6,
GlowFX = 7,
Snow = 10,
Rain = 11,
LightningFX = 14,
BlastFX = 15,
FlashFX = 16,
BlastFX2 = 18,
Padshock0 = 19,
Padshock1 = 20,
PadshockRange = 21,
DynamicLight = 22,
CameraShake = 23,
MotionBlur = 24,
RibbonFX2 = 27,
DrawGroup = 28,
LightningFX2 = 30,
Footprint = 33,
ParticleFX2 = 34,
WeatherLightning = 35,
ScreenShake2 = 36,
ParticleFX3 = 37,
InstanceFade = 38,
AdvancedInstanceFade = 39,
SpawnInstance = 40,
ZoomDistance = 41,
BurnFX = 42,
MiniSystem = 43,
AdditionalBurnStart = 44,
UnBurn = 45,
RandomSoundstream = 46,
KillAttachedParticles = 47,
KillParticlesByGroupID = 48,
Dirty = 49,
Wet = 50,
};
typedef struct
{
EffectType effectType;
ubyte modifierList[3];
} ObjectEffectData <read=EnumToString(effectType)>;
typedef struct
{
byte isVarSound;
byte pad[3] <hidden=true>;
int16 minVolDistance;
byte volume;
byte volumeVariation;
int sfxToneID;
float pitch;
float pitchVariation;
float delay;
float delayVariation;
float timeOut;
} AnimVariableSoundData;
typedef struct
{
byte isVarSound;
byte turnOnOff;
int16 blockingID;
char idx[8];
} AnimSoundStreamData;
typedef struct
{
int16 minVolDistance;
byte chance1;
byte chance2;
byte chance3;
byte volume1;
byte volume2;
byte volume3;
byte volumeVariation1;
byte volumeVariation2;
byte volumeVariation3;
byte pad <hidden=true>;
int sfxToneID1;
int sfxToneID2;
int sfxToneID3;
float pitch1;
float pitch2;
float pitch3;
float pitchVariation1;
float pitchVariation2;
float pitchVariation3;
float timeOut;
} AnimRandomSoundData;
// Effect frames
typedef struct
{
local int start = FTell();
AnimFxHeader effectHeader;
local CallbackType type = effectHeader.info.m_typeMask;
// Display the struct depending on the callback type and other logic
if (type == G2ANIM_VARSOUND_CALLBACK)
{
// Check isVarSound
if (ReadByte() == 1)
{
AnimVariableSoundData soundData;
}
else
{
AnimSoundStreamData soundData;
}
}
else if (type == G2ANIM_USER_CALLBACK)
{
uint16 callbackType;
}
else if (type == G2ANIM_EFFECT_CALLBACK)
{
ObjectEffectData effectData;
}
else if (type == G2ANIM_RNDSOUND_CALLBACK)
{
AnimRandomSoundData soundData;
}
// Skip the whole effect size
FSeek(start + effectHeader.info.m_fxSize * 4);
} ObjectEffectFXA <read=EnumToString(type)>;
typedef struct
{
// Read until we encounter the end marked by FF FF
while (ReadUShort() != 0xFFFF)
{
ObjectEffectFXA effect;
}
} FXAnim;
// The data
SectionHeader header;
FXAnim fxa;