-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexp.cpp
195 lines (176 loc) · 3.04 KB
/
exp.cpp
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
190
191
192
193
194
195
#include "exp.h"
#include "utils.h"
#include "mem.h"
#include "validate.h"
// @Ok
void Exp_SmallExplosion(CVector* a1)
{
if ( !LowMemory )
{
Exp_Frag(a1, Rnd(20), 6u, 750, 80);
Exp_GlowFlash(a1, 70, 0xF0u, 0xC8u, 0, 5, 0, 100);
}
}
// @Ok
void Exp_Frag(CVector* a1, i32 a2, i32 a3, i32 a4, i32 a5)
{
if (!LowMemory)
{
for (i32 i = 0; i < a2; i++)
{
new CFrag(a1, 0x80u, 0x80u, 0x80u, a3, a4, 1, a5, 12288, 30);
}
}
}
// @Ok
void Exp_BigExplosion(CVector *a1)
{
if ( !LowMemory )
{
Exp_Frag(a1, Rnd(20), 6u, 750, 80);
Exp_GlowFlash(a1, 200, 0xF0u, 0xC8u, 0, 5, 0, 100);
}
}
// @NotOk
// @FIXME guess type of field_40
CFlameExplosion::~CFlameExplosion(void)
{
for (i32 i = 0; i < 20; i++)
{
delete reinterpret_cast<CItem*>(field_40[i]);
}
}
// @Ok
CFlameExplosion::CFlameExplosion(
CVector* a2,
i32 a3,
i32 a4,
i32 a5)
{
this->mPos = *a2;
this->field_E = a3;
this->field_3E = a5;
this->field_3F = a4;
}
// @Ok
CGlowFlash::CGlowFlash(
CVector* a2,
i32 a3,
u8 a4,
u8 a5,
u8 a6,
i32 a7,
u8 a8,
u8 a9,
u8 a10,
i32 a11,
i32 a12,
i32 a13,
i32 a14,
i32 a15,
i32 a16,
i32 a17,
i32 a18,
i32 a19,
i32 a20)
: CGlow(a3, 1)
{
this->mPos = *a2;
this->SetCentreRGB(a4, a5, a6);
this->field_5C = a7;
this->SetRGB(a8, a9, a10);
this->field_5E = a11;
this->SetFringeRGB(0, 0, 0, 0);
this->SetFringeWidth(0, a12);
this->field_60 = a13;
this->field_6C = a14;
this->field_64 = a16;
this->field_62 = a15;
this->field_6A = a19;
this->field_66 = a17;
this->field_68 = a18;
this->field_E = a20;
print_if_false(a20 || this->field_5C, "CGlowFlash centrefaderate and lifetime both zero.");
this->ChooseRadii();
}
// @SMALLTODO
void CGlowFlash::ChooseRadii(void)
{
printf("CGlowFlash::ChooseRadii(void)");
}
// @SMALLTODO
void CGlowFlash::Move(void)
{
printf("CGlowFlash::Move(void)");
}
// @SMALLTODO
void Exp_HitEnvItem(CItem* pItem, u32* pFace, i32 Damage)
{
printf("Exp_HitEnvItem");
}
// @Ok
void Exp_GlowFlash(
CVector* a1,
i32 a2,
u8 a3,
u8 a4,
u8 a5,
i32 a6,
i32 a7,
i32 a8)
{
if ( !LowMemory )
{
if ( a7 )
{
new CGlowFlash(
a1,
a6,
a3,
a4,
a5,
2,
a3,
a4,
a5,
20,
a8,
0,
0,
a2,
a2,
a2 / 2,
a2 / 2,
0,
0);
}
else
{
new CGlowFlash(a1, a6, a3, a4, a5, 2, a3, a4, a5, 20, a8, 0, 0, a2, 0, a2, 0, 0, 0);
}
}
}
void validate_CItemFrag(void)
{
VALIDATE_SIZE(CItemFrag, 0xB8);
}
void validate_CGlowFlash(void)
{
VALIDATE_SIZE(CGlowFlash, 0x70);
VALIDATE(CGlowFlash, field_5C, 0x5C);
VALIDATE(CGlowFlash, field_5E, 0x5E);
VALIDATE(CGlowFlash, field_60, 0x60);
VALIDATE(CGlowFlash, field_62, 0x62);
VALIDATE(CGlowFlash, field_64, 0x64);
VALIDATE(CGlowFlash, field_66, 0x66);
VALIDATE(CGlowFlash, field_68, 0x68);
VALIDATE(CGlowFlash, field_6A, 0x6A);
VALIDATE(CGlowFlash, field_6C, 0x6C);
}
void validate_CFlameExplosion(void)
{
VALIDATE_SIZE(CFlameExplosion, 0x90);
VALIDATE(CFlameExplosion, field_3E, 0x3E);
VALIDATE(CFlameExplosion, field_3F, 0x3F);
VALIDATE(CFlameExplosion, field_40, 0x40);
}