Mercurial > mm7
annotate stru6.cpp @ 1159:da80e03c677c
Render::DrawProjectile cleanup (correct)
author | Grumpy7 |
---|---|
date | Mon, 03 Jun 2013 23:26:05 +0200 |
parents | 3395579f6c4d |
children | 96a81634669e |
rev | line source |
---|---|
0 | 1 #include "stru6.h" |
1016 | 2 |
3 #include "mm7_data.h" | |
4 #include "LightmapBuilder.h" | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
5 #include "SpriteObject.h" |
0 | 6 #include "IndoorCameraD3D.h" |
7 #include "ParticleEngine.h" | |
8 #include "Game.h" | |
9 #include "LOD.h" | |
10 #include "Sprites.h" | |
11 #include "DecalBuilder.h" | |
12 #include "ObjectList.h" | |
13 #include "Actor.h" | |
14 #include "Random.h" | |
15 #include "Spells.h" | |
16 #include "IconFrameTable.h" | |
17 #include "Time.h" | |
18 #include "Viewport.h" | |
19 #include "PaletteManager.h" | |
20 #include "Overlays.h" | |
21 #include "stru160.h" | |
1051 | 22 #include "Math.h" |
0 | 23 |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
24 #include "MM7.h" |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
25 |
0 | 26 |
27 | |
28 | |
29 | |
1106
3395579f6c4d
stru6_stru1_indoor_sw_billboard destructor fix, removing "extern" from struct definition, fixing probable typo in SPELL_AIR_SPARKS
Grumpy7
parents:
1102
diff
changeset
|
30 //----- (004775C4) -------------------------------------------------------- |
3395579f6c4d
stru6_stru1_indoor_sw_billboard destructor fix, removing "extern" from struct definition, fixing probable typo in SPELL_AIR_SPARKS
Grumpy7
parents:
1102
diff
changeset
|
31 stru6_stru1_indoor_sw_billboard::~stru6_stru1_indoor_sw_billboard() |
3395579f6c4d
stru6_stru1_indoor_sw_billboard destructor fix, removing "extern" from struct definition, fixing probable typo in SPELL_AIR_SPARKS
Grumpy7
parents:
1102
diff
changeset
|
32 { |
3395579f6c4d
stru6_stru1_indoor_sw_billboard destructor fix, removing "extern" from struct definition, fixing probable typo in SPELL_AIR_SPARKS
Grumpy7
parents:
1102
diff
changeset
|
33 if (pArray1) |
3395579f6c4d
stru6_stru1_indoor_sw_billboard destructor fix, removing "extern" from struct definition, fixing probable typo in SPELL_AIR_SPARKS
Grumpy7
parents:
1102
diff
changeset
|
34 delete [] pArray1; |
3395579f6c4d
stru6_stru1_indoor_sw_billboard destructor fix, removing "extern" from struct definition, fixing probable typo in SPELL_AIR_SPARKS
Grumpy7
parents:
1102
diff
changeset
|
35 pArray1 = nullptr; |
3395579f6c4d
stru6_stru1_indoor_sw_billboard destructor fix, removing "extern" from struct definition, fixing probable typo in SPELL_AIR_SPARKS
Grumpy7
parents:
1102
diff
changeset
|
36 |
3395579f6c4d
stru6_stru1_indoor_sw_billboard destructor fix, removing "extern" from struct definition, fixing probable typo in SPELL_AIR_SPARKS
Grumpy7
parents:
1102
diff
changeset
|
37 if (pArray2) |
3395579f6c4d
stru6_stru1_indoor_sw_billboard destructor fix, removing "extern" from struct definition, fixing probable typo in SPELL_AIR_SPARKS
Grumpy7
parents:
1102
diff
changeset
|
38 delete [] pArray2; |
3395579f6c4d
stru6_stru1_indoor_sw_billboard destructor fix, removing "extern" from struct definition, fixing probable typo in SPELL_AIR_SPARKS
Grumpy7
parents:
1102
diff
changeset
|
39 pArray2 = nullptr; |
3395579f6c4d
stru6_stru1_indoor_sw_billboard destructor fix, removing "extern" from struct definition, fixing probable typo in SPELL_AIR_SPARKS
Grumpy7
parents:
1102
diff
changeset
|
40 } |
3395579f6c4d
stru6_stru1_indoor_sw_billboard destructor fix, removing "extern" from struct definition, fixing probable typo in SPELL_AIR_SPARKS
Grumpy7
parents:
1102
diff
changeset
|
41 |
0 | 42 |
43 //----- (00478211) -------------------------------------------------------- | |
44 void stru6_stru1_indoor_sw_billboard::Initialize(int a2) | |
45 { | |
46 uNumVec4sInArray1 = 66; | |
47 pArray1 = new stru16x[66]; | |
48 | |
49 uNumVec3sInArray2 = 128; | |
50 pArray2 = new stru160[128]; | |
51 | |
52 for (uint i = 0; i < uNumVec4sInArray1; ++i) | |
53 { | |
54 pArray1[i].field_0 = array_4EB8B8[i].field_0; | |
55 pArray1[i].field_4 = array_4EB8B8[i].field_4; | |
56 pArray1[i].field_8 = array_4EB8B8[i].field_8; | |
57 pArray1[i].field_C = a2; | |
58 } | |
59 memcpy(pArray2, array_4EBBD0_x/*array_4EBBD0*/, uNumVec3sInArray2 * sizeof(stru160)); | |
60 } | |
61 | |
62 //----- (0047829F) -------------------------------------------------------- | |
63 void stru6_stru1_indoor_sw_billboard::_47829F_fireball_collision(float arg0, float a3, float a4, float a5, int a2) | |
64 { | |
65 stru6_stru1_indoor_sw_billboard *v6; // esi@1 | |
66 int v7; // edi@1 | |
67 char *v8; // eax@2 | |
68 signed int v9; // ecx@2 | |
69 int v10; // edx@3 | |
70 signed int i; // [sp+8h] [bp-4h]@1 | |
71 | |
72 auto a1 = this; | |
73 | |
74 v6 = a1; | |
75 v7 = 0; | |
76 for ( i = 0; i < (signed int)v6->uNumVec3sInArray2; ++i ) | |
77 { | |
78 v8 = (char *)&v6->field_14[1]; | |
79 v9 = 3; | |
80 do | |
81 { | |
82 *((float *)v8 - 1) = a5 * *(&v6->pArray1->field_0 + 4 * *(int *)((char *)&v6->pArray2->field_0 + v7)) + arg0; | |
83 *(float *)v8 = a5 * *(&v6->pArray1->field_4 + 4 * *(int *)((char *)&v6->pArray2->field_0 + v7)) + a3; | |
84 v8 += 16; | |
85 *((float *)v8 - 3) = a5 * *(&v6->pArray1->field_8 + 4 * *(int *)((char *)&v6->pArray2->field_0 + v7)) + a4; | |
86 v10 = *(int *)((char *)&v6->pArray2->field_0 + v7); | |
87 v7 += 4; | |
88 --v9; | |
89 *((int *)v8 - 2) = *((int *)&v6->pArray1[1].field_0 + 4 * v10); | |
90 } | |
91 while ( v9 ); | |
92 v6->field_10 = 3; | |
93 if ( v6->sub_477C61() && v6->sub_477F63() ) | |
94 { | |
95 if ( v6->sub_47802A() ) | |
96 pRenderer->_4A4CC9(v6, a2); | |
97 } | |
98 } | |
99 } | |
100 | |
101 | |
102 | |
103 | |
104 //----- (004A71FE) -------------------------------------------------------- | |
105 void stru6::DoAddProjectile(float srcX, float srcY, float srcZ, float dstX, float dstY, float dstZ, unsigned int uTextureID) | |
106 { | |
486 | 107 //int v8; // eax@1 |
0 | 108 |
486 | 109 //v8 = uNumProjectiles; |
110 if (uNumProjectiles < 32) | |
0 | 111 { |
486 | 112 pProjectiles[uNumProjectiles].srcX = srcX; |
113 pProjectiles[uNumProjectiles].srcY = srcY; | |
0 | 114 pProjectiles[uNumProjectiles].srcZ = srcZ; |
115 pProjectiles[uNumProjectiles].dstX = dstX; | |
116 pProjectiles[uNumProjectiles].dstY = dstY; | |
117 pProjectiles[uNumProjectiles].dstZ = dstZ; | |
118 pProjectiles[uNumProjectiles++].uTextureID = uTextureID; | |
119 } | |
120 } | |
121 | |
122 //----- (004A7298) -------------------------------------------------------- | |
123 void stru6::DrawProjectiles() | |
124 { | |
125 float v10; // ST1C_4@8 | |
126 float v11; // ST0C_4@8 | |
127 IDirect3DTexture2 *v12; // [sp+20h] [bp-78h]@6 | |
128 RenderVertexSoft v[2]; // [sp+30h] [bp-68h]@1 | |
129 | |
130 for (uint i = 0; i < uNumProjectiles; ++i) | |
131 { | |
132 auto p = pProjectiles + i; | |
133 | |
134 v[0].vWorldPosition.x = p->srcX; | |
135 v[0].vWorldPosition.y = p->srcY; | |
136 v[0].vWorldPosition.z = p->srcZ; | |
137 v[1].vWorldPosition.x = p->dstX; | |
138 v[1].vWorldPosition.y = p->dstY; | |
139 v[1].vWorldPosition.z = p->dstZ; | |
140 pGame->pIndoorCameraD3D->ViewTransform(v, 2); | |
141 | |
142 sr_42620A(v); | |
143 | |
144 pGame->pIndoorCameraD3D->Project(v, 2, 0); | |
145 | |
146 if (p->uTextureID != -1) | |
147 v12 = pBitmaps_LOD->pHardwareTextures[p->uTextureID]; | |
148 else | |
149 v12 = 0; | |
150 | |
151 v10 = pGame->pIndoorCameraD3D->fov_x / v[1].vWorldViewPosition.x * 20.0; | |
152 v11 = pGame->pIndoorCameraD3D->fov_x / v[0].vWorldViewPosition.x * 20.0; | |
153 pRenderer->DrawProjectile( | |
154 v[0].vWorldViewProjX, | |
155 v[0].vWorldViewProjY, | |
156 v[0].vWorldViewPosition.x, | |
157 v11, | |
158 v[1].vWorldViewProjX, | |
159 v[1].vWorldViewProjY, | |
160 v[1].vWorldViewPosition.x, | |
161 v10, | |
162 v12); | |
163 } | |
164 } | |
165 | |
166 //----- (004A73AA) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
167 void stru6::_4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(SpriteObject *a2, unsigned int uDiffuse, unsigned int uTextureID) |
0 | 168 { |
169 stru6 *v4; // edi@1 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
170 SpriteObject *v5; // esi@1 |
0 | 171 int v6; // eax@1 |
172 stru6_stru2 *v7; // eax@2 | |
173 double v8; // st7@2 | |
174 double v9; // st6@2 | |
175 double v10; // st7@3 | |
619 | 176 Particle_sw local_0; // [sp+8h] [bp-68h]@1 |
0 | 177 float x; // [sp+78h] [bp+8h]@2 |
178 | |
179 v4 = this; | |
180 memset(&local_0, 0, 0x68u); | |
181 v5 = a2; | |
182 v6 = a2->field_54; | |
183 if ( v6 ) | |
184 { | |
486 | 185 v7 = &v4->array_4[v6 & 0x1F]; |
186 x = ((double)a2->vPosition.x - v7->flt_0_x) * 0.5 + v7->flt_0_x; | |
187 v8 = ((double)v5->vPosition.y - v7->flt_4_y) * 0.5 + v7->flt_4_y; | |
188 v9 = ((double)v5->vPosition.z - v7->flt_8_z) * 0.5 + v7->flt_8_z; | |
619 | 189 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; |
0 | 190 local_0.uDiffuse = uDiffuse; |
191 local_0.x = x + 4.0; | |
192 local_0.y = v8; | |
193 local_0.z = v9; | |
194 local_0.flt_10 = 0.0; | |
195 local_0.flt_14 = 0.0; | |
196 local_0.flt_18 = 0.0; | |
197 local_0.timeToLive = (rand() & 0x40) + 96; | |
198 local_0.uTextureID = uTextureID; | |
199 local_0.flt_28 = 1.0; | |
200 pGame->pParticleEngine->AddParticle(&local_0); | |
201 local_0.x = x - 4.0; | |
202 pGame->pParticleEngine->AddParticle(&local_0); | |
203 local_0.x = (double)v5->vPosition.x + 4.0; | |
204 local_0.y = (double)v5->vPosition.y; | |
205 local_0.z = (double)v5->vPosition.z; | |
206 pGame->pParticleEngine->AddParticle(&local_0); | |
207 local_0.x = (double)v5->vPosition.x - 4.0; | |
208 pGame->pParticleEngine->AddParticle(&local_0); | |
486 | 209 v4->array_4[v5->field_54 & 0x1F].flt_0_x = (double)v5->vPosition.x; |
210 v4->array_4[v5->field_54 & 0x1F].flt_4_y = (double)v5->vPosition.y; | |
211 v4->array_4[v5->field_54 & 0x1F].flt_8_z = (double)v5->vPosition.z; | |
0 | 212 } |
213 else | |
214 { | |
486 | 215 a2->field_54 = v4->field_0++; |
216 v4->array_4[a2->field_54 & 0x1F].flt_0_x = (double)a2->vPosition.x; | |
217 v4->array_4[a2->field_54 & 0x1F].flt_4_y = (double)a2->vPosition.y; | |
218 v4->array_4[a2->field_54 & 0x1F].flt_8_z = (double)a2->vPosition.z; | |
0 | 219 v10 = (double)a2->vPosition.x; |
619 | 220 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; |
0 | 221 local_0.uDiffuse = uDiffuse; |
222 local_0.x = v10 + 4.0; | |
223 local_0.y = (double)a2->vPosition.y; | |
224 local_0.z = (double)a2->vPosition.z; | |
225 local_0.flt_10 = 0.0; | |
226 local_0.flt_14 = 0.0; | |
227 local_0.flt_18 = 0.0; | |
228 local_0.flt_28 = 1.0; | |
229 local_0.timeToLive = (rand() & 0x7F) + 128; | |
230 local_0.uTextureID = uTextureID; | |
231 pGame->pParticleEngine->AddParticle(&local_0); | |
232 local_0.x = (double)a2->vPosition.x - 4.0; | |
233 pGame->pParticleEngine->AddParticle(&local_0); | |
234 } | |
235 } | |
236 | |
237 //----- (004A75CC) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
238 void stru6::_4A75CC_single_spell_collision_particle(SpriteObject *a1, unsigned int uDiffuse, unsigned int uTextureID) |
0 | 239 { |
240 double v4; // st7@1 | |
241 signed int v5; // edi@1 | |
619 | 242 Particle_sw local_0; // [sp+8h] [bp-68h]@1 |
0 | 243 |
244 memset(&local_0, 0, 0x68u); | |
619 | 245 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_1; |
0 | 246 local_0.x = (double)a1->vPosition.x; |
247 local_0.y = (double)a1->vPosition.y; | |
248 v4 = (double)a1->vPosition.z; | |
249 local_0.uDiffuse = uDiffuse; | |
250 local_0.z = v4; | |
251 v5 = 10; | |
252 local_0.timeToLive = (rand() & 0x7F) + 128; | |
253 local_0.uTextureID = uTextureID; | |
254 local_0.flt_28 = 1.0; | |
255 do | |
256 { | |
257 local_0.flt_10 = (double)(rand() & 0x1FF) - 255.0; | |
258 local_0.flt_14 = (double)(rand() & 0x1FF) - 255.0; | |
259 local_0.flt_18 = (double)(rand() & 0x1FF) - 255.0; | |
260 pGame->pParticleEngine->AddParticle(&local_0); | |
261 --v5; | |
262 } | |
263 while ( v5 ); | |
264 } | |
265 | |
266 //----- (004A7688) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
267 void stru6::_4A7688_fireball_collision_particle(SpriteObject *a2) |
0 | 268 { |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
269 SpriteObject *v2; // esi@1 |
0 | 270 double v3; // st7@1 |
271 double v4; // st7@2 | |
272 double v5; // st7@4 | |
273 int v6; // eax@6 | |
274 float v7; // ST0C_4@6 | |
275 float v8; // ST08_4@6 | |
276 float v9; // ST04_4@6 | |
277 float v10; // ST00_4@6 | |
619 | 278 Particle_sw local_0; // [sp+1Ch] [bp-7Ch]@1 |
0 | 279 stru6 *v12; // [sp+84h] [bp-14h]@1 |
280 float v13; // [sp+88h] [bp-10h]@1 | |
281 double v14; // [sp+8Ch] [bp-Ch]@5 | |
282 float v15; // [sp+94h] [bp-4h]@4 | |
283 signed int i; // [sp+A0h] [bp+8h]@4 | |
284 signed int a2b; // [sp+A0h] [bp+8h]@6 | |
285 | |
286 v12 = this; | |
287 memset(&local_0, 0, 0x68u); | |
288 v2 = a2; | |
289 v3 = (double)a2->uSpriteFrameID / (double)pObjectList->pObjects[a2->uObjectDescID].uLifetime; | |
290 v13 = 512.0 * v3; | |
291 if ( v3 >= 0.75 ) | |
292 v4 = (1.0 - v3) * 4.0; | |
293 else | |
294 v4 = v3 * 1.333333333333333; | |
295 v15 = v4; | |
296 v5 = (double)a2->vPosition.x; | |
619 | 297 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_1; |
298 local_0.uDiffuse = 0xFF3C1E; | |
0 | 299 local_0.x = v5; |
300 local_0.y = (double)a2->vPosition.y; | |
301 local_0.z = (double)a2->vPosition.z; | |
302 local_0.timeToLive = (rand() & 0x7F) + 128; | |
303 local_0.uTextureID = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT); | |
304 i = 10; | |
305 local_0.flt_28 = 1.0; | |
306 do | |
307 { | |
308 HIDWORD(v14) = rand() & 0x1FF; | |
309 local_0.flt_10 = (double)SHIDWORD(v14) - 255.0; | |
310 HIDWORD(v14) = rand() & 0x1FF; | |
311 local_0.flt_14 = (double)SHIDWORD(v14) - 255.0; | |
312 WORD2(v14) = rand() & 0x1FF; | |
313 HIDWORD(v14) = WORD2(v14); | |
314 local_0.flt_18 = (double)WORD2(v14) - 255.0; | |
315 pGame->pParticleEngine->AddParticle(&local_0); | |
316 --i; | |
317 } | |
318 while ( i ); | |
319 v14 = v13 + 6.7553994e15; | |
320 a2b = LODWORD(v14); | |
321 v6 = sub_4A7063(0xFF3C1Eu, v15); | |
322 v7 = (double)a2b; | |
323 v8 = (double)v2->vPosition.z; | |
324 v9 = (double)v2->vPosition.y; | |
325 v10 = (double)v2->vPosition.x; | |
326 v12->pStru1->_47829F_fireball_collision(v10, v9, v8, v7, v6); | |
327 } | |
328 | |
329 //----- (004A77FD) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
330 void stru6::_4A77FD_some_stuff_d3d(SpriteObject *a1) |
0 | 331 { |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
332 SpriteObject *v2; // esi@1 |
0 | 333 stru6 *v3; // edi@1 |
334 double v4; // st7@1 | |
335 double v5; // st7@2 | |
336 double v6; // ST1C_8@4 | |
337 int v7; // eax@4 | |
338 float v8; // ST0C_4@4 | |
339 float v9; // ST08_4@4 | |
340 float v10; // ST04_4@4 | |
341 float v11; // ST00_4@4 | |
342 float v12; // [sp+28h] [bp-4h]@1 | |
343 float a1a; // [sp+34h] [bp+8h]@4 | |
344 | |
345 v2 = a1; | |
346 v3 = this; | |
347 v4 = (double)a1->uSpriteFrameID / (double)pObjectList->pObjects[a1->uObjectDescID].uLifetime; | |
348 v12 = 512.0 - v4 * 512.0; | |
349 if ( v4 >= 0.75 ) | |
350 v5 = v4 * 4.0; | |
351 else | |
352 v5 = v4 * 1.333333333333333; | |
353 a1a = v5; | |
354 v6 = v12 + 6.7553994e15; | |
355 v7 = sub_4A7063(0x7E7E7Eu, a1a); | |
356 v8 = (double)SLODWORD(v6); | |
357 v9 = (double)v2->vPosition.z; | |
358 v10 = (double)v2->vPosition.y; | |
359 v11 = (double)v2->vPosition.x; | |
360 v3->pStru1->_47829F_fireball_collision(v11, v10, v9, v8, v7); | |
361 } | |
362 | |
363 //----- (004A78AE) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
364 void stru6::_4A78AE_sparks_spell(SpriteObject *a1) |
0 | 365 { |
366 ObjectDesc *v2; // esi@1 | |
367 unsigned int v3; // eax@1 | |
368 double v4; // st7@1 | |
619 | 369 Particle_sw local_0; // [sp+8h] [bp-68h]@1 |
0 | 370 |
371 v2 = &pObjectList->pObjects[a1->uObjectDescID]; | |
372 memset(&local_0, 0, 0x68u); | |
373 v3 = a1->uSpriteFrameID; | |
374 local_0.x = (double)a1->vPosition.x; | |
375 v4 = (double)a1->vPosition.y; | |
619 | 376 local_0.type = ParticleType_Sprite; |
377 local_0.uDiffuse = 0x7F7F7F; | |
0 | 378 local_0.timeToLive = 1; |
379 local_0.y = v4; | |
380 local_0.z = (double)a1->vPosition.z; | |
381 local_0.flt_10 = 0.0; | |
382 local_0.flt_14 = 0.0; | |
383 local_0.flt_18 = 0.0; | |
384 local_0.uTextureID = pSpriteFrameTable->GetFrame(v2->uSpriteID, v3)->pHwSpriteIDs[0]; | |
385 LODWORD(local_0.flt_28) = 0x40000000u; | |
386 pGame->pParticleEngine->AddParticle(&local_0); | |
387 } | |
388 | |
389 //----- (004A7948) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
390 void stru6::_4A7948_mind_blast_after_effect(SpriteObject *a1) |
0 | 391 { |
392 ObjectDesc *v2; // esi@1 | |
393 unsigned int v3; // eax@1 | |
394 double v4; // st7@1 | |
395 char v5; // al@1 | |
396 signed int v6; // edi@1 | |
619 | 397 Particle_sw Dst; // [sp+8h] [bp-68h]@1 |
0 | 398 |
399 v2 = &pObjectList->pObjects[a1->uObjectDescID]; | |
400 memset(&Dst, 0, 0x68u); | |
401 v3 = a1->uSpriteFrameID; | |
402 Dst.x = (double)a1->vPosition.x; | |
403 v4 = (double)a1->vPosition.y; | |
619 | 404 Dst.type = ParticleType_Sprite | ParticleType_Rotating | ParticleType_1; |
405 Dst.uDiffuse = 0x7F7F7F; | |
0 | 406 Dst.y = v4; |
407 Dst.z = (double)a1->vPosition.z; | |
408 Dst.uTextureID = pSpriteFrameTable->GetFrame(v2->uSpriteID, v3)->pHwSpriteIDs[0]; | |
409 v5 = rand(); | |
410 v6 = 10; | |
411 Dst.flt_28 = 1.0; | |
412 Dst.timeToLive = (v5 & 0x7F) + 128; | |
413 do | |
414 { | |
415 Dst.flt_10 = (double)(rand() & 0x1FF) - 255.0; | |
416 Dst.flt_14 = (double)(rand() & 0x1FF) - 255.0; | |
417 Dst.flt_18 = (double)(rand() & 0x1FF) - 255.0; | |
418 pGame->pParticleEngine->AddParticle(&Dst); | |
419 --v6; | |
420 } | |
421 while ( v6 ); | |
422 } | |
423 | |
424 //----- (004A7A27) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
425 bool stru6::AddMobileLight(SpriteObject *a1, unsigned int uDiffuse, int uRadius) |
0 | 426 { |
427 return pMobileLightsStack->AddLight( | |
428 a1->vPosition.x, | |
429 a1->vPosition.y, | |
430 a1->vPosition.z, | |
431 a1->uSectorID, | |
432 uRadius, | |
433 (uDiffuse & 0x00FF0000) >> 16, | |
434 (uDiffuse & 0x0000FF00) >> 8, | |
435 uDiffuse & 0x000000FF, | |
436 byte_4E94D3); | |
437 } | |
438 // 4E94D3: using guessed type char byte_4E94D3; | |
439 | |
440 //----- (004A7A66) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
441 void stru6::_4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(SpriteObject *a1, unsigned int uDiffuse, unsigned int uTextureID, float a4) |
0 | 442 { |
443 int v5; // eax@1 | |
444 char v6; // al@1 | |
445 double v7; // st6@1 | |
446 double v8; // st6@1 | |
447 double v9; // st7@1 | |
448 double v10; // st6@1 | |
619 | 449 Particle_sw local_0; // [sp+0h] [bp-6Ch]@1 |
0 | 450 float v12; // [sp+68h] [bp-4h]@1 |
451 float a1a; // [sp+74h] [bp+8h]@1 | |
452 float uDiffusea; // [sp+78h] [bp+Ch]@1 | |
453 float uTextureIDa; // [sp+7Ch] [bp+10h]@1 | |
454 | |
455 memset(&local_0, 0, 0x68u); | |
619 | 456 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_1; |
0 | 457 local_0.x = (double)a1->vPosition.x; |
458 v5 = a1->vPosition.z; | |
459 local_0.y = (double)a1->vPosition.y; | |
460 local_0.uDiffuse = uDiffuse; | |
461 local_0.z = (double)(v5 + 32); | |
462 v6 = rand(); | |
463 local_0.flt_28 = 1.0; | |
464 v7 = 0.0 * a4; | |
465 local_0.timeToLive = (v6 & 0x7F) + 128; | |
466 local_0.uTextureID = uTextureID; | |
467 a1a = v7; | |
468 local_0.flt_10 = v7; | |
469 local_0.flt_14 = a4; | |
470 local_0.flt_18 = a4; | |
471 pGame->pParticleEngine->AddParticle(&local_0); | |
472 v8 = 0.70710677 * a4; | |
473 uDiffusea = v8; | |
474 local_0.flt_10 = v8; | |
475 local_0.flt_14 = v8; | |
476 local_0.flt_18 = a4; | |
477 pGame->pParticleEngine->AddParticle(&local_0); | |
478 local_0.flt_14 = a1a; | |
479 local_0.flt_10 = a4; | |
480 local_0.flt_18 = a4; | |
481 pGame->pParticleEngine->AddParticle(&local_0); | |
482 local_0.flt_10 = uDiffusea; | |
483 local_0.flt_18 = a4; | |
484 v9 = -uDiffusea; | |
485 uTextureIDa = v9; | |
486 local_0.flt_14 = v9; | |
487 pGame->pParticleEngine->AddParticle(&local_0); | |
488 v10 = -1.0 * a4; | |
489 local_0.flt_10 = a1a; | |
490 v12 = v10; | |
491 local_0.flt_14 = v10; | |
492 local_0.flt_18 = a4; | |
493 pGame->pParticleEngine->AddParticle(&local_0); | |
494 local_0.flt_18 = a4; | |
495 local_0.flt_10 = uTextureIDa; | |
496 local_0.flt_14 = uTextureIDa; | |
497 pGame->pParticleEngine->AddParticle(&local_0); | |
498 local_0.flt_10 = v12; | |
499 local_0.flt_14 = a1a; | |
500 local_0.flt_18 = a4; | |
501 pGame->pParticleEngine->AddParticle(&local_0); | |
502 local_0.flt_10 = uTextureIDa; | |
503 local_0.flt_14 = uDiffusea; | |
504 local_0.flt_18 = a4; | |
505 pGame->pParticleEngine->AddParticle(&local_0); | |
506 } | |
507 | |
508 //----- (004A7C07) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
509 void stru6::_4A7C07(SpriteObject *a2) |
0 | 510 { |
511 stru6 *v2; // edi@1 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
512 SpriteObject *v3; // esi@1 |
0 | 513 int v4; // eax@1 |
514 ObjectDesc *v5; // ebx@1 | |
515 stru6_stru2 *v6; // eax@2 | |
516 double v7; // st6@2 | |
517 double v8; // st5@2 | |
518 double v9; // st4@2 | |
519 char v10; // al@2 | |
520 double v11; // st7@2 | |
521 double v12; // st7@3 | |
619 | 522 Particle_sw local_0; // [sp+Ch] [bp-68h]@1 |
0 | 523 float a2a; // [sp+7Ch] [bp+8h]@2 |
524 | |
525 v2 = this; | |
526 memset(&local_0, 0, 0x68u); | |
527 v3 = a2; | |
528 v4 = a2->field_54; | |
529 v5 = &pObjectList->pObjects[a2->uObjectDescID]; | |
530 if ( v4 ) | |
531 { | |
486 | 532 v6 = &v2->array_4[v4 & 0x1F]; |
533 v7 = ((double)a2->vPosition.x - v6->flt_0_x) * 0.5 + v6->flt_0_x; | |
534 v8 = ((double)a2->vPosition.y - v6->flt_4_y) * 0.5 + v6->flt_4_y; | |
535 v9 = ((double)a2->vPosition.z - v6->flt_8_z) * 0.5 + v6->flt_8_z; | |
619 | 536 local_0.type = ParticleType_Sprite; |
537 local_0.uDiffuse = 0xFFFFFF; | |
0 | 538 a2a = v9; |
539 local_0.x = v7; | |
540 local_0.z = a2a; | |
541 local_0.y = v8; | |
542 local_0.flt_10 = 0.0; | |
543 local_0.flt_14 = 0.0; | |
544 local_0.flt_18 = 0.0; | |
545 v10 = rand(); | |
546 LODWORD(local_0.flt_28) = 0x40400000u; | |
547 local_0.timeToLive = (v10 & 0x3F) + 64; | |
548 local_0.uTextureID = pSpriteFrameTable->GetFrame(v5->uSpriteID, v3->uSpriteFrameID)->pHwSpriteIDs[0]; | |
549 pGame->pParticleEngine->AddParticle(&local_0); | |
550 v11 = (double)v3->vPosition.x; | |
551 LODWORD(local_0.flt_28) = 0x40800000u; | |
552 local_0.x = v11; | |
553 local_0.y = (double)v3->vPosition.y; | |
554 local_0.z = (double)v3->vPosition.z; | |
555 local_0.timeToLive = (rand() & 0x3F) + 64; | |
556 pGame->pParticleEngine->AddParticle(&local_0); | |
486 | 557 v2->array_4[v3->field_54 & 0x1F].flt_0_x = (double)v3->vPosition.x; |
558 v2->array_4[v3->field_54 & 0x1F].flt_4_y = (double)v3->vPosition.y; | |
559 v2->array_4[v3->field_54 & 0x1F].flt_8_z = (double)v3->vPosition.z; | |
0 | 560 } |
561 else | |
562 { | |
486 | 563 a2->field_54 = v2->field_0++; |
564 v2->array_4[a2->field_54 & 0x1F].flt_0_x = (double)a2->vPosition.x; | |
565 v2->array_4[a2->field_54 & 0x1F].flt_4_y = (double)a2->vPosition.y; | |
566 v2->array_4[a2->field_54 & 0x1F].flt_8_z = (double)a2->vPosition.z; | |
0 | 567 v12 = (double)a2->vPosition.x; |
619 | 568 local_0.type = ParticleType_Sprite; |
569 local_0.uDiffuse = 0xFFFFFF; | |
0 | 570 LODWORD(local_0.flt_28) = 0x40000000u; |
571 local_0.x = v12; | |
572 local_0.y = (double)a2->vPosition.y; | |
573 local_0.z = (double)a2->vPosition.z; | |
574 local_0.flt_10 = 0.0; | |
575 local_0.flt_14 = 0.0; | |
576 local_0.flt_18 = 0.0; | |
577 local_0.timeToLive = (rand() & 0x3F) + 64; | |
578 local_0.uTextureID = pSpriteFrameTable->GetFrame(v5->uSpriteID, a2->uSpriteFrameID)->pHwSpriteIDs[0]; | |
579 pGame->pParticleEngine->AddParticle(&local_0); | |
580 } | |
581 } | |
582 | |
583 //----- (004A7E05) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
584 void stru6::AddProjectile(SpriteObject *a2, int a3, unsigned int uTextureID) |
0 | 585 { |
586 int v4; // edx@1 | |
587 float v5; // ST14_4@2 | |
588 float v6; // ST10_4@2 | |
589 float v7; // ST0C_4@2 | |
590 | |
591 v4 = a2->field_54; | |
592 if ( v4 ) | |
593 { | |
594 v5 = (double)a2->vPosition.z; | |
595 v6 = (double)a2->vPosition.y; | |
596 v7 = (double)a2->vPosition.x; | |
597 DoAddProjectile( | |
486 | 598 this->array_4[v4 & 0x1F].flt_0_x, |
599 this->array_4[v4 & 0x1F].flt_4_y, | |
600 this->array_4[v4 & 0x1F].flt_8_z, | |
0 | 601 v7, |
602 v6, | |
603 v5, | |
604 uTextureID); | |
605 } | |
606 else | |
607 { | |
486 | 608 a2->field_54 = this->field_0++; |
609 this->array_4[a2->field_54 & 0x1F].flt_0_x = (double)a2->vPosition.x; | |
610 this->array_4[a2->field_54 & 0x1F].flt_4_y = (double)a2->vPosition.y; | |
611 this->array_4[a2->field_54 & 0x1F].flt_8_z = (double)a2->vPosition.z; | |
0 | 612 } |
613 } | |
614 | |
615 //----- (004A7E89) -------------------------------------------------------- | |
142 | 616 void stru6::_4A7E89_sparkles_on_actor_after_it_casts_buff(Actor *pActor, unsigned int uDiffuse) |
0 | 617 { |
618 Actor *v3; // edi@1 | |
619 int v4; // ebx@3 | |
142 | 620 //int result; // eax@5 |
619 | 621 Particle_sw Dst; // [sp+Ch] [bp-6Ch]@1 |
0 | 622 int v7; // [sp+74h] [bp-4h]@2 |
623 signed int pActora; // [sp+80h] [bp+8h]@1 | |
624 | |
625 memset(&Dst, 0, 0x68u); | |
619 | 626 Dst.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; |
0 | 627 Dst.timeToLive = (rand() & 0x7F) + 128; |
628 v3 = pActor; | |
629 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar02", TEXTURE_DEFAULT); | |
630 pActora = 50; | |
631 Dst.flt_28 = 1.0; | |
632 do | |
633 { | |
634 v7 = (unsigned __int8)rand() + v3->vPosition.x - 127; | |
635 Dst.x = (double)v7; | |
636 v7 = (unsigned __int8)rand() + v3->vPosition.y - 127; | |
637 Dst.y = (double)v7; | |
638 v7 = v3->vPosition.z + (unsigned __int8)rand(); | |
639 Dst.z = (double)v7; | |
640 if ( uDiffuse ) | |
641 { | |
642 Dst.uDiffuse = uDiffuse; | |
643 } | |
644 else | |
645 { | |
646 v4 = rand() << 16; | |
647 Dst.uDiffuse = rand() | v4; | |
648 } | |
649 pGame->pParticleEngine->AddParticle(&Dst); | |
650 --pActora; | |
651 } | |
652 while ( pActora ); | |
653 } | |
654 | |
655 //----- (004A7F74) -------------------------------------------------------- | |
656 void stru6::_4A7F74(int x, int y, int z) | |
657 { | |
658 stru6 *v4; // esi@1 | |
659 char v5; // al@1 | |
660 signed int v6; // edi@1 | |
661 unsigned int v7; // eax@1 | |
662 double v8; // st7@2 | |
663 double v9; // st7@2 | |
619 | 664 Particle_sw local_0; // [sp+8h] [bp-78h]@1 |
0 | 665 double v11; // [sp+70h] [bp-10h]@1 |
666 double v12; // [sp+78h] [bp-8h]@1 | |
667 float z1; // [sp+88h] [bp+8h]@2 | |
668 | |
669 v4 = this; | |
670 memset(&local_0, 0, 0x68u); | |
619 | 671 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_1; |
672 local_0.uDiffuse = 0x7E7E7E; | |
0 | 673 v5 = rand(); |
674 local_0.flt_28 = 1.0; | |
675 v6 = 8; | |
676 local_0.timeToLive = (v5 & 0x7F) + 128; | |
677 v7 = v4->uTextureID_effpar1; | |
678 v12 = (double)x; | |
679 local_0.uTextureID = v7; | |
680 v11 = (double)y; | |
681 do | |
682 { | |
683 v8 = pRnd->GetRandom(); | |
684 local_0.x = v8 * 40.0 - 20.0 + v12; | |
685 v9 = pRnd->GetRandom(); | |
686 z1 = (double)z; | |
687 local_0.z = z1; | |
688 local_0.y = v9 * 40.0 - 20.0 + v11; | |
689 local_0.flt_10 = pRnd->GetRandom() * 400.0 - 200.0; | |
690 local_0.flt_14 = pRnd->GetRandom() * 400.0 - 200.0; | |
691 local_0.flt_18 = pRnd->GetRandom() * 150.0 + 50.0; | |
692 pGame->pParticleEngine->AddParticle(&local_0); | |
693 --v6; | |
694 } | |
695 while ( v6 ); | |
696 } | |
697 | |
698 //----- (004A806F) -------------------------------------------------------- | |
699 int stru6::_4A806F(Actor *pActor) | |
700 { | |
701 int v2; // ecx@1 | |
702 unsigned int v3; // eax@1 | |
703 double v4; // st7@2 | |
704 float v5; // ST00_4@6 | |
705 | |
706 v2 = (int)pActor; | |
707 v3 = LODWORD(pActor->pActorBuffs[10].uExpireTime) - pMiscTimer->uTotalGameTimeElapsed; | |
708 if ( (signed int)v3 <= 64 ) | |
709 { | |
710 if ( (v3 & 0x80000000u) != 0 ) | |
711 { | |
712 pActor->pActorBuffs[10].uExpireTime = 0i64; | |
713 v4 = 1.0; | |
714 } | |
715 else | |
716 { | |
717 v2 = v3 * v3; | |
718 v4 = 1.0 - (double)(signed int)(v3 * v3) * 0.0001953125; | |
719 } | |
720 } | |
721 else | |
722 { | |
723 v2 = (v3 - 64) * (v3 - 64); | |
724 v4 = (double)v2 * 0.0001953125 + 0.2; | |
725 } | |
726 v5 = v4; | |
1029 | 727 return fixpoint_from_float(v5); |
0 | 728 } |
729 | |
730 //----- (004A80DC) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
731 void stru6::_4A80DC_some_stuff_sw(SpriteObject *a2) |
0 | 732 { |
733 stru6 *v2; // esi@1 | |
734 signed int v3; // ebx@1 | |
619 | 735 Particle_sw local_0; // [sp+Ch] [bp-68h]@1 |
0 | 736 |
737 v2 = this; | |
738 memset(&local_0, 0, 0x68u); | |
619 | 739 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_1; |
740 local_0.uDiffuse = 0x7E7E7E; | |
0 | 741 local_0.timeToLive = (rand() & 0x7F) + 128; |
742 local_0.uTextureID = v2->uTextureID_effpar1; | |
743 v3 = 8; | |
744 local_0.flt_28 = 1.0; | |
745 do | |
746 { | |
747 local_0.x = pRnd->GetRandom() * 40.0 + (double)a2->vPosition.x - 20.0; | |
748 local_0.y = pRnd->GetRandom() * 40.0 + (double)a2->vPosition.y - 20.0; | |
749 local_0.z = (double)a2->vPosition.z; | |
750 local_0.flt_10 = pRnd->GetRandom() * 800.0 - 400.0; | |
751 local_0.flt_14 = pRnd->GetRandom() * 800.0 - 400.0; | |
752 local_0.flt_18 = pRnd->GetRandom() * 350.0 + 50.0; | |
753 pGame->pParticleEngine->AddParticle(&local_0); | |
754 --v3; | |
755 } | |
756 while ( v3 ); | |
757 } | |
758 | |
759 //----- (004A81CA) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
760 bool stru6::_4A81CA(SpriteObject *a2) |
0 | 761 { |
564 | 762 //stru6 *v2; // ebx@1 |
0 | 763 int result; // eax@1 |
764 int v4; // eax@27 | |
564 | 765 //unsigned int diffuse; // esi@41 |
766 //int v6; // ecx@49 | |
0 | 767 int v7; // eax@54 |
768 int v8; // eax@55 | |
769 char v9; // zf@56 | |
770 int v10; // eax@59 | |
771 int v11; // eax@61 | |
772 int v12; // eax@85 | |
773 int v13; // eax@86 | |
774 int v14; // eax@96 | |
775 int v15; // eax@111 | |
776 int v16; // eax@118 | |
777 int v17; // eax@139 | |
778 int v18; // eax@140 | |
779 int v19; // eax@141 | |
780 int v20; // eax@151 | |
564 | 781 //unsigned int v21; // [sp-8h] [bp-20h]@66 |
782 //SpriteObject *v22; // [sp-8h] [bp-20h]@81 | |
783 //unsigned int v23; // [sp-4h] [bp-1Ch]@4 | |
784 //unsigned int v24; // [sp-4h] [bp-1Ch]@5 | |
0 | 785 unsigned int v25; // [sp-4h] [bp-1Ch]@30 |
564 | 786 //unsigned int v26; // [sp-4h] [bp-1Ch]@57 |
787 //unsigned int v27; // [sp-4h] [bp-1Ch]@66 | |
788 //int v28; // [sp-4h] [bp-1Ch]@81 | |
789 //unsigned int v29; // [sp+0h] [bp-18h]@4 | |
790 //unsigned int v30; // [sp+0h] [bp-18h]@5 | |
791 //int v31; // [sp+0h] [bp-18h]@30 | |
792 //unsigned int v32; // [sp+0h] [bp-18h]@45 | |
793 //float v33; // [sp+0h] [bp-18h]@57 | |
794 //float v34; // [sp+0h] [bp-18h]@66 | |
795 //signed int v35; // [sp+0h] [bp-18h]@81 | |
0 | 796 char pContainer[7]; // [sp+10h] [bp-8h]@81 |
797 | |
564 | 798 //__debugbreak(); // need to refactor carefully & collect data |
799 //v2 = this; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
800 result = a2->uType; |
564 | 801 |
802 switch (a2->uType) | |
803 { | |
796
14beae4f1723
Last observable issues with walking in dragon cave fixed.
Nomad
parents:
733
diff
changeset
|
804 case 500: // blue rat bolt for example |
14beae4f1723
Last observable issues with walking in dragon cave fixed.
Nomad
parents:
733
diff
changeset
|
805 case 530: |
14beae4f1723
Last observable issues with walking in dragon cave fixed.
Nomad
parents:
733
diff
changeset
|
806 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x00AAAFF, uTextureID_effpar1); |
14beae4f1723
Last observable issues with walking in dragon cave fixed.
Nomad
parents:
733
diff
changeset
|
807 return false; |
14beae4f1723
Last observable issues with walking in dragon cave fixed.
Nomad
parents:
733
diff
changeset
|
808 |
14beae4f1723
Last observable issues with walking in dragon cave fixed.
Nomad
parents:
733
diff
changeset
|
809 case 510: // dragon fire for example |
14beae4f1723
Last observable issues with walking in dragon cave fixed.
Nomad
parents:
733
diff
changeset
|
810 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xFF3C1E, uTextureID_effpar1); |
14beae4f1723
Last observable issues with walking in dragon cave fixed.
Nomad
parents:
733
diff
changeset
|
811 return false; |
14beae4f1723
Last observable issues with walking in dragon cave fixed.
Nomad
parents:
733
diff
changeset
|
812 |
567 | 813 case 545: |
564 | 814 case 550: |
815 case 555: return true; | |
816 | |
817 case 556: | |
818 AddMobileLight(a2, 0xFF0000, 256); | |
819 return false; | |
820 | |
821 case 600: | |
822 AddMobileLight(a2, 0xFF3C1E, 256); | |
823 return true; | |
824 | |
825 case 1010: // Fire Bolt | |
826 { | |
827 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xFF3C1E, uTextureID_effpar1); | |
828 AddMobileLight(a2, 0xFF3C1E, 256); | |
829 } | |
830 return false; | |
831 | |
832 case 1011: // Fire Bolt impact | |
833 { | |
834 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1E, uTextureID_effpar1); | |
835 AddMobileLight(a2, 0xFF3C1E, 256); | |
836 } | |
837 return false; | |
838 | |
839 case 1050: // Fireball | |
840 { | |
841 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xFF3C1E, uTextureID_effpar1); | |
842 AddMobileLight(a2, 0xFF3C1E, 256); | |
843 } | |
844 return false; | |
845 | |
846 case 1051: // Fireball hit | |
847 { | |
848 AddMobileLight(a2, 0xFF3C1E, 256); | |
849 if (pRenderer->pRenderD3D) | |
850 { | |
848 | 851 result = PID_TYPE(a2->spell_caster_pid); |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
852 if (PID_TYPE(a2->spell_caster_pid) != OBJECT_Actor && |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
853 PID_TYPE(a2->spell_caster_pid) != OBJECT_Item) |
564 | 854 { |
855 if (field_204 != 4) | |
856 { | |
857 field_204++; | |
858 _4A7688_fireball_collision_particle(a2); | |
859 } | |
860 return false; | |
861 } | |
862 } | |
863 } | |
864 return true; | |
865 | |
866 case 1081: | |
867 { | |
868 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xFF3C1E, uTextureID_effpar1, 300.0); | |
869 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xFF3C1E, uTextureID_effpar1, 250.0); | |
870 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xFF3C1E, uTextureID_effpar1, 200.0); | |
871 AddMobileLight(a2, 0xFF3C1E, 256); | |
872 } | |
873 return false; | |
874 | |
875 case 2101: | |
876 { | |
877 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xC8C814, uTextureID_effpar1, 200.0); | |
878 AddMobileLight(a2, 0xC8C814, 256); | |
879 } | |
880 return false; | |
881 | |
882 case 3060: // Acid Burst | |
883 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x0AB450, uTextureID_effpar1); | |
884 AddMobileLight(a2, 0x0AB450, 256); | |
885 return false; | |
886 | |
887 case 9000: return true; | |
888 } | |
889 | |
567 | 890 if ( result < 545 ) |
0 | 891 { |
564 | 892 __debugbreak(); // find out what kind of spells are these |
1102 | 893 // when summoned light elemental attacks |
567 | 894 |
0 | 895 result -= 500; |
896 switch ( result ) | |
897 { | |
898 case 1: | |
899 case 31: | |
564 | 900 _4A75CC_single_spell_collision_particle(a2, 0xAAAFF, uTextureID_effpar1); |
901 return true; | |
0 | 902 case 5: |
564 | 903 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x5C310E, uTextureID_effpar1); |
904 return false; | |
0 | 905 case 15: |
564 | 906 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x0062D0, uTextureID_effpar1); |
907 return false; | |
0 | 908 case 16: |
564 | 909 _4A75CC_single_spell_collision_particle(a2, 0x0062D0, uTextureID_effpar1); |
910 return false; | |
0 | 911 case 20: |
564 | 912 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x0AB450, uTextureID_effpar1); |
913 return false; | |
0 | 914 case 21: |
564 | 915 _4A75CC_single_spell_collision_particle(a2, 0x0AB450, uTextureID_effpar1); |
916 return false; | |
0 | 917 case 25: |
564 | 918 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xC8C805, uTextureID_effpar1); |
919 return false; | |
0 | 920 case 26: |
564 | 921 _4A75CC_single_spell_collision_particle(a2, 0xC8C805, uTextureID_effpar1); |
922 return false; | |
0 | 923 case 35: |
564 | 924 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xFFFFFF, uTextureID_effpar1); |
925 return false; | |
0 | 926 case 36: |
564 | 927 _4A75CC_single_spell_collision_particle(a2, 0xFFFFFF, uTextureID_effpar1); |
928 return false; | |
929 | |
0 | 930 case 40: |
564 | 931 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x7E7E7E, uTextureID_effpar1); |
932 return false; | |
933 | |
0 | 934 case 11: |
564 | 935 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1E, uTextureID_effpar1); |
936 return false; | |
0 | 937 case 6: |
564 | 938 _4A75CC_single_spell_collision_particle(a2, 0x5C310E, uTextureID_effpar1); |
939 return false; | |
940 | |
0 | 941 case 41: |
564 | 942 _4A75CC_single_spell_collision_particle(a2, 0x7E7E7E, uTextureID_effpar1); |
943 return false; | |
0 | 944 default: |
564 | 945 return false; |
0 | 946 } |
564 | 947 return false; |
0 | 948 } |
564 | 949 |
0 | 950 if ( result <= 4051 ) |
951 { | |
952 if ( result != 4051 ) | |
953 { | |
954 if ( result <= 2031 ) | |
955 { | |
956 if ( result != 2031 ) | |
957 { | |
564 | 958 if ( result < 1051 ) |
0 | 959 { |
564 | 960 if ( result < 600 ) |
0 | 961 { |
564 | 962 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1E, uTextureID_effpar1); |
963 return false; | |
0 | 964 } |
965 if ( result < 811 ) | |
564 | 966 return false; |
0 | 967 if ( result <= 814 ) |
564 | 968 return true; |
969 return false; | |
970 | |
0 | 971 } |
972 if ( result <= 1081 ) | |
973 { | |
564 | 974 if (result != 1081) |
0 | 975 { |
976 result -= 1060; | |
977 if ( !result ) | |
564 | 978 return true; |
0 | 979 v7 = result - 1; |
980 if ( v7 ) | |
981 { | |
982 v8 = v7 - 9; | |
983 if ( !v8 ) | |
984 { | |
564 | 985 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1E, uTextureID_effpar1); |
986 return false; | |
0 | 987 } |
988 result = v8 - 10; | |
989 v9 = result == 0; | |
564 | 990 //LABEL_129: |
0 | 991 if ( v9 ) |
564 | 992 return true; |
993 return false; | |
0 | 994 } |
564 | 995 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xFF3C1E, uTextureID_effpar1, 250.0); |
996 AddMobileLight(a2, 0xFF3C1E, 256); | |
997 return false; | |
0 | 998 } |
564 | 999 //LABEL_84: |
1000 // _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, diffuse, v26, v33); | |
1001 //goto LABEL_43; | |
1002 return false; | |
0 | 1003 } |
1004 v10 = result - 1090; | |
1005 if ( v10 ) | |
1006 { | |
1007 result = v10 - 10; | |
1008 if ( !result ) | |
564 | 1009 return true; |
0 | 1010 v11 = result - 1; |
1011 if ( !v11 ) | |
1012 { | |
564 | 1013 //diffuse = 0xFF3C1E; |
1014 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1E, uTextureID_effpar1); | |
1015 //v32 = v2->uTextureID_effpar1; | |
1016 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1E, uTextureID_effpar1); | |
1017 //goto LABEL_43; | |
1018 AddMobileLight(a2, 0xFF3C1E, 256); | |
1019 return false; | |
0 | 1020 } |
1021 result = v11 - 929; | |
1022 if ( result ) | |
564 | 1023 return false; |
1024 //LABEL_63: | |
0 | 1025 if ( !pRenderer->pRenderD3D ) |
564 | 1026 return true; |
0 | 1027 _4A78AE_sparks_spell(a2); |
564 | 1028 AddMobileLight(a2, 0x64640F, 128); |
1029 return false; | |
0 | 1030 } |
564 | 1031 |
1032 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xFF3C1Eu, uTextureID_effpar1, 250.0); | |
1033 return false; | |
0 | 1034 } |
564 | 1035 //goto LABEL_67; |
0 | 1036 } |
564 | 1037 if ( result < 3060 ) |
0 | 1038 { |
564 | 1039 if ( result < 2101 ) |
0 | 1040 { |
1041 if ( result != 2060 ) | |
1042 { | |
1043 if ( result != 2061 ) | |
1044 { | |
1045 if ( result <= 2079 ) | |
564 | 1046 return false; |
0 | 1047 if ( result <= 2081 ) |
1048 { | |
1049 if ( pRenderer->pRenderD3D ) | |
1050 _4A77FD_some_stuff_d3d(a2); | |
1051 else | |
1052 _4A80DC_some_stuff_sw(a2); | |
564 | 1053 return false; |
0 | 1054 } |
1055 v9 = result == 2100; | |
564 | 1056 if ( v9 ) |
1057 return true; | |
1058 return false; | |
0 | 1059 } |
564 | 1060 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xC8C814, uTextureID_effpar2, 200.0); |
1061 AddMobileLight(a2, 0xC8C814, 256); | |
1062 return false; | |
0 | 1063 } |
1064 if ( !pRenderer->pRenderD3D ) | |
564 | 1065 return true; |
0 | 1066 memcpy(pContainer, "sp18h1", 7); |
1067 pRnd->SetRange(1, 6); | |
1068 pContainer[5] = pRnd->GetInRange() + '0'; | |
564 | 1069 AddProjectile(a2, 100, pBitmaps_LOD->LoadTexture(pContainer)); |
1070 return false; | |
0 | 1071 } |
1072 v12 = result - 3010; | |
1073 if ( !v12 ) | |
1074 { | |
564 | 1075 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xAB450, uTextureID_effpar1); |
1076 AddMobileLight(a2, 0xAB450, 256); | |
1077 return false; | |
0 | 1078 } |
1079 v13 = v12 - 1; | |
1080 if ( !v13 ) | |
1081 { | |
564 | 1082 _4A75CC_single_spell_collision_particle(a2, 0xAB450, uTextureID_effpar1); |
1083 AddMobileLight(a2, 0xAB450, 256); | |
1084 return false; | |
0 | 1085 } |
1086 result = v13 - 19; | |
1087 if ( !result ) | |
564 | 1088 return true; |
0 | 1089 --result; |
1090 if ( result ) | |
564 | 1091 return false; |
1092 | |
1093 _4A75CC_single_spell_collision_particle(a2, 0x9EB9F1, uTextureID_effpar1); | |
1094 AddMobileLight(a2, 0x9EB9F1, 256); | |
1095 return false; | |
0 | 1096 } |
1097 if ( result > 4000 ) | |
1098 { | |
1099 result -= 4030; | |
1100 if ( !result || (--result, !result) ) | |
564 | 1101 return true; |
0 | 1102 result -= 19; |
1103 v9 = result == 0; | |
564 | 1104 if ( v9 ) |
1105 return true; | |
1106 return false; | |
0 | 1107 } |
1108 if ( result == 4000 ) | |
1109 { | |
1110 if ( !pRenderer->pRenderD3D ) | |
564 | 1111 return true; |
0 | 1112 _4A7C07(a2); |
564 | 1113 return false; |
0 | 1114 } |
1115 result -= 3061; | |
1116 if ( !result || (result -= 29) == 0 ) | |
564 | 1117 return true; |
0 | 1118 v14 = result - 1; |
1119 if ( !v14 ) | |
564 | 1120 { |
1121 _4A75CC_single_spell_collision_particle(a2, 0x9EB9F1, uTextureID_effpar1); | |
1122 AddMobileLight(a2, 0x9EB9F1, 256); | |
1123 return false; | |
1124 } | |
0 | 1125 result = v14 - 1; |
1126 if ( result ) | |
564 | 1127 return false; |
1128 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x9EB9F1, uTextureID_effpar1); | |
1129 return false; | |
0 | 1130 } |
564 | 1131 _4A7948_mind_blast_after_effect(a2); |
1132 return false; | |
0 | 1133 } |
1134 if ( result <= 7090 ) | |
1135 { | |
1136 if ( result == 7090 ) | |
564 | 1137 return true; |
0 | 1138 if ( result > 6030 ) |
1139 { | |
1140 if ( result > 6091 ) | |
1141 { | |
1142 result -= 6100; | |
1143 if ( !result ) | |
564 | 1144 return true; |
0 | 1145 result -= 930; |
1146 if ( result ) | |
1147 { | |
1148 --result; | |
564 | 1149 if (!result) |
1150 _4A75CC_single_spell_collision_particle(a2, 0xF00000, uTextureID_effpar1); | |
1151 return false; | |
0 | 1152 } |
564 | 1153 if ( !pRenderer->pRenderD3D ) |
1154 return true; | |
1155 _4A78AE_sparks_spell(a2); | |
1156 AddMobileLight(a2, 0x64640F, 128); | |
1157 return false; | |
0 | 1158 } |
1159 if ( result != 6091 ) | |
1160 { | |
1161 result -= 6040; | |
1162 if ( !result || (result -= 20) == 0 || (result -= 10) == 0 ) | |
564 | 1163 return true; |
0 | 1164 result -= 20; |
1165 v9 = result == 0; | |
564 | 1166 if ( v9 ) |
1167 return true; | |
1168 return false; | |
0 | 1169 } |
1170 } | |
1171 else | |
1172 { | |
1173 if ( result == 6030 ) | |
564 | 1174 return true; |
0 | 1175 if ( result <= 4091 ) |
1176 { | |
1177 if ( result != 4091 ) | |
1178 { | |
1179 result -= 4070; | |
1180 if ( !result ) | |
564 | 1181 return true; |
0 | 1182 v15 = result - 1; |
1183 if ( v15 ) | |
1184 { | |
1185 result = v15 - 9; | |
1186 if ( !result ) | |
564 | 1187 return true; |
0 | 1188 result -= 10; |
1189 if ( !result ) | |
1190 { | |
564 | 1191 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x7E7E7E, uTextureID_effpar1); |
1192 return true; | |
0 | 1193 } |
564 | 1194 return false; |
0 | 1195 } |
564 | 1196 _4A75CC_single_spell_collision_particle(a2, 0x5C310E, uTextureID_effpar1); |
1197 return false; | |
0 | 1198 } |
564 | 1199 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0x7E7E7E, uTextureID_effpar1, 200.0); |
1200 return false; | |
0 | 1201 } |
1202 v16 = result - 4092; | |
1203 if ( !v16 ) | |
1204 { | |
564 | 1205 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x7E7E7E, uTextureID_effpar1); |
1206 return false; | |
0 | 1207 } |
1208 result = v16 - 8; | |
1209 if ( !result ) | |
564 | 1210 return false; |
0 | 1211 result -= 1910; |
1212 if ( !result ) | |
564 | 1213 return true; |
0 | 1214 --result; |
1215 if ( result ) | |
564 | 1216 return false; |
0 | 1217 } |
564 | 1218 //LABEL_122: |
0 | 1219 _4A7948_mind_blast_after_effect(a2); |
564 | 1220 return false; |
0 | 1221 } |
1222 if ( result <= 9000 ) | |
1223 { | |
1224 if ( result <= 8030 ) | |
1225 { | |
1226 if ( result == 8030 ) | |
564 | 1227 return true; |
0 | 1228 v17 = result - 7091; |
1229 if ( v17 ) | |
1230 { | |
1231 v18 = v17 - 909; | |
1232 if ( !v18 ) | |
1233 { | |
564 | 1234 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xFFFFFF, uTextureID_effpar3); |
1235 AddMobileLight(a2, 0xFFFFFF, 128); | |
1236 return false; | |
0 | 1237 } |
1238 v19 = v18 - 1; | |
1239 if ( v19 ) | |
1240 { | |
1241 result = v19 - 9; | |
1242 if ( !result ) | |
1243 { | |
564 | 1244 AddMobileLight(a2, 0xFFFFFF, 64); |
1245 return false; | |
0 | 1246 } |
564 | 1247 return false; |
0 | 1248 } |
564 | 1249 _4A75CC_single_spell_collision_particle(a2, 0xFFFFFF, uTextureID_effpar2); |
1250 AddMobileLight(a2, 0xFFFFFF, 256); | |
1251 return false; | |
0 | 1252 } |
1253 else | |
1254 { | |
564 | 1255 _4A75CC_single_spell_collision_particle(a2, 0xF00000, uTextureID_effpar1); |
1256 AddMobileLight(a2, 0xF00000, 256); | |
1257 return false; | |
0 | 1258 } |
1259 } | |
1260 result -= 8040; | |
1261 if ( !result || (result -= 20) == 0 ) | |
564 | 1262 return true; |
0 | 1263 v20 = result - 30; |
1264 if ( v20 ) | |
1265 { | |
1266 result = v20 - 1; | |
1267 if ( result ) | |
564 | 1268 return false; |
1269 | |
1270 _4A75CC_single_spell_collision_particle(a2, 0xFFFFFF, uTextureID_effpar3); | |
1271 return false; | |
0 | 1272 } |
564 | 1273 AddMobileLight(a2, 0xFFFFFFu, 128); |
0 | 1274 if ( !pRenderer->pRenderD3D ) |
564 | 1275 return true; |
1276 AddProjectile(a2, 100, -1); | |
1277 return false; | |
0 | 1278 } |
1279 if ( result > 9050 ) | |
1280 { | |
1281 result -= 9070; | |
1282 if ( !result || (result -= 10) == 0 || (--result, !result) ) | |
564 | 1283 return true; |
1284 return false; | |
0 | 1285 } |
1286 if ( result == 9050 || (result -= 9010) == 0 || (result -= 20) == 0 || (result -= 10) == 0 ) | |
564 | 1287 return true; |
0 | 1288 --result; |
1289 if ( !result ) | |
1290 { | |
564 | 1291 //LABEL_164: |
1292 _4A75CC_single_spell_collision_particle(a2, 0x7E7E7E, uTextureID_effpar1); | |
1293 return false; | |
0 | 1294 } |
564 | 1295 //LABEL_168: |
1296 return false; | |
0 | 1297 } |
1298 | |
1299 //----- (004A89BD) -------------------------------------------------------- | |
486 | 1300 void stru6::SetPlayerBuffAnim(unsigned __int16 uSpellID, unsigned __int16 uPlayerID) |
0 | 1301 { |
486 | 1302 //stru6 *v3; // edi@1 |
0 | 1303 PlayerBuffAnim *v4; // esi@1 |
1304 const char *v6; // [sp-4h] [bp-10h]@2 | |
1305 | |
486 | 1306 v4 = &pPlayerBuffs[uPlayerID]; |
491 | 1307 v4->uSpellAnimTimeElapsed = 0; |
486 | 1308 v4->bRender = uSpellID != 0; |
1309 | |
1310 switch (uSpellID) | |
0 | 1311 { |
920 | 1312 case SPELL_DISEASE: |
0 | 1313 v6 = "zapp"; |
486 | 1314 break; |
1315 | |
495 | 1316 case BECOME_MAGIC_GUILD_MEMBER: |
0 | 1317 case SPELL_AIR_FEATHER_FALL: |
1318 case SPELL_SPIRIT_DETECT_LIFE: | |
486 | 1319 case SPELL_SPIRIT_FATE: |
0 | 1320 v6 = "spboost1"; |
486 | 1321 break; |
1322 | |
501 | 1323 case SPELL_QUEST_COMPLETED: |
486 | 1324 case SPELL_AIR_INVISIBILITY: |
0 | 1325 case SPELL_WATER_WATER_WALK: |
486 | 1326 case SPELL_SPIRIT_PRESERVATION: |
0 | 1327 v6 = "spboost2"; |
486 | 1328 break; |
1329 | |
488 | 1330 case SPELL_152: |
486 | 1331 __debugbreak(); // spell id == 152 wtf |
1332 case SPELL_LIGHT_HOUR_OF_POWER: | |
1333 case SPELL_LIGHT_DAY_OF_THE_GODS: | |
1334 case SPELL_LIGHT_DAY_OF_PROTECTION: | |
1335 case SPELL_LIGHT_DIVINE_INTERVENTION: | |
0 | 1336 v6 = "spboost3"; |
486 | 1337 break; |
1338 | |
1339 case SPELL_SPIRIT_REMOVE_CURSE: | |
0 | 1340 case SPELL_MIND_REMOVE_FEAR: |
1341 case SPELL_BODY_CURE_WEAKNESS: | |
1342 v6 = "spheal1"; | |
486 | 1343 break; |
1344 | |
1345 case SPELL_SPIRIT_SHARED_LIFE: | |
0 | 1346 case SPELL_MIND_CURE_PARALYSIS: |
486 | 1347 case SPELL_MIND_CURE_INSANITY: |
0 | 1348 case SPELL_BODY_FIRST_AID: |
1349 case SPELL_BODY_CURE_POISON: | |
1350 case SPELL_BODY_CURE_DISEASE: | |
486 | 1351 case SPELL_DARK_SACRIFICE: |
0 | 1352 v6 = "spheal2"; |
486 | 1353 break; |
1354 | |
1355 case SPELL_BODY_POWER_CURE: | |
1356 case SPELL_DARK_SOULDRINKER: | |
0 | 1357 v6 = "spheal3"; |
486 | 1358 break; |
1359 | |
0 | 1360 case SPELL_FIRE_PROTECTION_FROM_FIRE: |
486 | 1361 case SPELL_FIRE_IMMOLATION: |
0 | 1362 v6 = "spell03"; |
486 | 1363 break; |
1364 | |
1365 case SPELL_FIRE_HASTE: v6 = "spell05"; break; | |
1366 case SPELL_AIR_PROTECTION_FROM_AIR: v6 = "spell14"; break; | |
1367 case SPELL_AIR_SHIELD: v6 = "spell17"; break; | |
1368 case SPELL_WATER_PROTECTION_FROM_WATER: v6 = "spell25"; break; | |
1369 case SPELL_EARTH_PROTECTION_FROM_EARTH: v6 = "spell36"; break; | |
1370 case SPELL_EARTH_STONESKIN: v6 = "spell38"; break; | |
1371 case SPELL_SPIRIT_BLESS: v6 = "spell46"; break; | |
1372 case SPELL_SPIRIT_HEROISM: v6 = "spell51"; break; | |
1373 case SPELL_SPIRIT_RESSURECTION: v6 = "spell55"; break; | |
1374 case SPELL_MIND_PROTECTION_FROM_MIND: v6 = "spell58"; break; | |
1375 case SPELL_BODY_PROTECTION_FROM_BODY: v6 = "spell69"; break; | |
1376 case SPELL_BODY_REGENERATION: v6 = "spell71"; break; | |
1377 case SPELL_BODY_HAMMERHANDS: v6 = "spell73"; break; | |
1378 case SPELL_BODY_PROTECTION_FROM_MAGIC: v6 = "spell75"; break; | |
1379 | |
0 | 1380 default: |
486 | 1381 v4->bRender = false; |
1382 return; | |
0 | 1383 } |
486 | 1384 |
1385 v4->uSpellIconID = pIconsFrameTable->FindIcon(v6); | |
1386 if (v4->bRender) | |
1387 v4->uSpellAnimTime = 8 * pIconsFrameTable->pIcons[v4->uSpellIconID].uAnimLength; | |
0 | 1388 } |
1389 | |
1390 //----- (004A8BDF) -------------------------------------------------------- | |
1391 void stru6::FadeScreen__like_Turn_Undead_and_mb_Armageddon(unsigned int uDiffuseColor, unsigned int uFadeTime) | |
1392 { | |
1393 this->uFadeTime = uFadeTime; | |
1394 this->uFadeTime2 = uFadeTime; | |
1395 this->uFadeColor = uDiffuseColor; | |
1396 } | |
1397 | |
1398 //----- (004A8BFC) -------------------------------------------------------- | |
1399 int stru6::_4A8BFC() | |
1400 { | |
1401 stru6 *v1; // esi@1 | |
1402 int result; // eax@1 | |
1403 | |
1404 v1 = this; | |
1405 result = 8 | |
1406 * pSpriteFrameTable->pSpriteSFrames[pSpriteFrameTable->FastFindSprite("spell84")].uAnimLength; | |
1407 v1->uAnimLength = result; | |
1408 return result; | |
1409 } | |
1410 | |
1411 //----- (004A8C27) -------------------------------------------------------- | |
1412 void stru6::RenderSpecialEffects() | |
1413 { | |
1414 double v4; // st7@4 | |
1415 double v5; // st6@4 | |
1416 double v6; // st7@4 | |
1417 float v7; // ST14_4@6 | |
1418 unsigned int v8; // ST14_4@8 | |
1419 unsigned int v9; // eax@8 | |
1420 SpriteFrame *v10; // eax@8 | |
1421 int v11; // edi@8 | |
1422 double v12; // st7@9 | |
1423 double v13; // st7@9 | |
1424 double v14; // st7@9 | |
1425 double v15; // st6@9 | |
1426 HRESULT v16; // eax@9 | |
1427 HRESULT v17; // eax@9 | |
1428 signed __int64 v18; // qtt@10 | |
1429 const char *v19; // [sp+4h] [bp-E8h]@0 | |
1430 int v20; // [sp+8h] [bp-E4h]@0 | |
1431 unsigned int v21; // [sp+Ch] [bp-E0h]@0 | |
1432 RenderBillboardTransform_local0 vsr; // [sp+10h] [bp-DCh]@10 | |
1433 RenderVertexD3D3 vd3d[4]; // [sp+60h] [bp-8Ch]@9 | |
1434 int v24; // [sp+E0h] [bp-Ch]@10 | |
1435 SpriteFrame *v70; // [sp+E4h] [bp-8h]@8 | |
1436 unsigned int v26; // [sp+E8h] [bp-4h]@3 | |
1437 | |
1438 if (uNumProjectiles) | |
1439 { | |
1440 DrawProjectiles(); | |
1441 uNumProjectiles = 0; | |
1442 } | |
1443 | |
1444 field_204 = 0; | |
1445 v26 = uFadeTime; | |
1446 if ( v26 > 0 ) | |
1447 { | |
1448 v4 = (double)(signed int)v26 / (double)uFadeTime2; | |
1449 v5 = 1.0 - v4 * v4; | |
1450 v6 = v5; | |
1451 if ( v5 > 0.9 ) | |
1452 v6 = 1.0 - (v5 - 0.9) * 10.0; | |
1453 v7 = v6; | |
1454 pRenderer->_4A52F1(uFadeColor, v7); | |
1455 uFadeTime -= pEventTimer->uTimeElapsed; | |
1456 } | |
1457 | |
1458 if (uAnimLength > 0) | |
1459 { | |
1460 v8 = 8 | |
1461 * pSpriteFrameTable->pSpriteSFrames[pSpriteFrameTable->FastFindSprite("spell84")].uAnimLength | |
1462 - uAnimLength; | |
1463 v9 = pSpriteFrameTable->FastFindSprite("spell84"); | |
1464 v10 = pSpriteFrameTable->GetFrame(v9, v8); | |
1465 v11 = v10->pHwSpriteIDs[0]; | |
1466 v70 = v10; | |
1467 uAnimLength -= pEventTimer->uTimeElapsed; | |
1468 if ( pRenderer->pRenderD3D ) | |
1469 { | |
693 | 1470 v12 = (double)(signed int)pViewport->uViewportTL_X; |
0 | 1471 vd3d[0].pos.x = v12; |
1472 vd3d[1].pos.x = v12; | |
693 | 1473 v13 = (double)(signed int)pViewport->uViewportBR_X; |
1474 v26 = pViewport->uViewportBR_Y + 1; | |
0 | 1475 vd3d[0].diffuse = 0x7F7F7Fu; |
1476 vd3d[1].diffuse = 0x7F7F7Fu; | |
1477 vd3d[2].pos.x = v13; | |
1478 vd3d[3].pos.x = v13; | |
693 | 1479 v14 = (double)(signed int)pViewport->uViewportTL_Y; |
0 | 1480 vd3d[2].diffuse = 0x7F7F7Fu; |
1481 vd3d[3].diffuse = 0x7F7F7Fu; | |
1482 vd3d[0].specular = 0; | |
1483 vd3d[1].specular = 0; | |
1484 vd3d[0].pos.y = v14; | |
693 | 1485 v15 = (double)(pViewport->uViewportBR_Y + 1); |
0 | 1486 vd3d[2].specular = 0; |
1487 vd3d[3].specular = 0; | |
1488 vd3d[1].pos.y = v15; | |
1489 vd3d[2].pos.y = v15; | |
1490 vd3d[3].pos.y = v14; | |
1491 vd3d[0].pos.z = 0.0; | |
1492 vd3d[1].pos.z = 0.0; | |
1493 vd3d[2].pos.z = 0.0; | |
1494 vd3d[3].pos.z = 0.0; | |
1495 vd3d[0].rhw = 1.0; | |
1496 vd3d[1].rhw = 1.0; | |
1497 vd3d[2].rhw = 1.0; | |
1498 vd3d[3].rhw = 1.0; | |
1499 vd3d[0].texcoord.x = 0.0; | |
1500 vd3d[1].texcoord.x = 0.0; | |
1501 vd3d[2].texcoord.x = 1.0; | |
1502 vd3d[3].texcoord.x = 1.0; | |
1503 vd3d[0].texcoord.y = 0.0; | |
1504 vd3d[1].texcoord.y = 1.0; | |
1505 vd3d[2].texcoord.y = 1.0; | |
1506 vd3d[3].texcoord.y = 0.0; | |
1507 pRenderer->pRenderD3D->pDevice->SetTexture( | |
1508 0, | |
1509 pSprites_LOD->pHardwareSprites[v11].pTexture); | |
186 | 1510 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGENABLE, FALSE); |
1511 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE); | |
1512 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, FALSE); | |
1513 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE); | |
1514 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ONE); | |
1515 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, FALSE); | |
1516 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZFUNC, D3DCMP_ALWAYS); | |
719 | 1517 pRenderer->pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, |
1518 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, vd3d, 4, 28); | |
186 | 1519 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE)); |
1520 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ZERO)); | |
1521 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, FALSE); | |
1522 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, TRUE); | |
1523 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, TRUE); | |
1524 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZFUNC, D3DCMP_LESS); | |
0 | 1525 } |
1526 else | |
1527 { | |
1528 vsr.pTarget = pRenderer->pTargetSurface; | |
1529 vsr.uParentBillboardID = -1; | |
1530 vsr.pTargetZ = pRenderer->pActiveZBuffer; | |
693 | 1531 vsr.uScreenSpaceX = (signed int)(pViewport->uViewportBR_X - pViewport->uViewportTL_X) / 2; |
1532 vsr.uScreenSpaceY = pViewport->uViewportBR_Y; | |
0 | 1533 v24 = 16777216; |
1534 LODWORD(v18) = 0; | |
693 | 1535 HIDWORD(v18) = (signed __int16)(LOWORD(pViewport->uViewportBR_X) - LOWORD(pViewport->uViewportTL_X)); |
144
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
142
diff
changeset
|
1536 vsr._screenspace_x_scaler_packedfloat = v18 / 0x1000000; |
0 | 1537 LODWORD(v18) = 0; |
693 | 1538 HIDWORD(v18) = (signed __int16)(LOWORD(pViewport->uViewportBR_Y) - LOWORD(pViewport->uViewportTL_Y)); |
0 | 1539 v26 = v18 / 16777216; |
144
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
142
diff
changeset
|
1540 vsr._screenspace_y_scaler_packedfloat = v18 / 0x1000000; |
0 | 1541 vsr.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v70->uPaletteIndex, 0, 1); |
1542 vsr.uTargetPitch = pRenderer->uTargetSurfacePitch; | |
1543 vsr.uParentBillboardID = -1; | |
693 | 1544 vsr.uViewportX = pViewport->uViewportTL_X; |
1545 vsr.uViewportZ = pViewport->uViewportBR_X; | |
1546 vsr.uViewportY = pViewport->uViewportTL_Y; | |
0 | 1547 vsr.sZValue = 0; |
693 | 1548 vsr.uViewportW = pViewport->uViewportBR_Y; |
0 | 1549 vsr.uFlags = 0; |
1550 if ( v11 >= 0 ) | |
733 | 1551 pSprites_LOD->pSpriteHeaders[v11].DrawSprite_sw(&vsr, 1); |
0 | 1552 } |
1553 } | |
1554 } | |
1555 | |
1556 //----- (004A902A) -------------------------------------------------------- | |
1557 void stru6::DrawPlayerBuffAnims() | |
1558 { | |
491 | 1559 for (uint i = 0; i < 4; ++i) |
1560 { | |
1561 auto buff = pPlayerBuffs + i; | |
1562 if (!buff->bRender) | |
1563 continue; | |
0 | 1564 |
491 | 1565 buff->uSpellAnimTimeElapsed += pEventTimer->uTimeElapsed; |
1566 if (buff->uSpellAnimTimeElapsed >= buff->uSpellAnimTime) | |
0 | 1567 { |
491 | 1568 buff->bRender = false; |
1569 continue; | |
0 | 1570 } |
491 | 1571 |
1572 auto icon = pIconsFrameTable->GetFrame(buff->uSpellIconID, buff->uSpellAnimTimeElapsed); | |
1573 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 385, pIcons_LOD->GetTexture(icon->uTextureID)); | |
1574 | |
1575 pOtherOverlayList->bRedraw = true; | |
0 | 1576 } |
1577 } | |
1578 | |
1579 //----- (004A90A0) -------------------------------------------------------- | |
1580 void stru6::LoadAnimations() | |
1581 { | |
1582 stru6 *v1; // esi@1 | |
1583 unsigned int v2; // eax@1 | |
1584 unsigned int v3; // eax@1 | |
1585 unsigned int v4; // eax@1 | |
1586 unsigned int v5; // eax@1 | |
1587 unsigned int v6; // eax@1 | |
1588 unsigned int v7; // eax@1 | |
1589 unsigned int v8; // eax@1 | |
1590 unsigned int v9; // eax@1 | |
1591 unsigned int v10; // eax@1 | |
1592 unsigned int v11; // eax@1 | |
1593 unsigned int v12; // eax@1 | |
1594 unsigned int v13; // eax@1 | |
1595 unsigned int v14; // eax@1 | |
1596 unsigned int v15; // eax@1 | |
1597 unsigned int v16; // eax@1 | |
1598 unsigned int v17; // eax@1 | |
1599 unsigned int v18; // eax@1 | |
1600 unsigned int v19; // eax@1 | |
1601 unsigned int v20; // eax@1 | |
1602 unsigned int v21; // eax@1 | |
1603 unsigned int v22; // eax@1 | |
1604 unsigned int v23; // eax@1 | |
1605 unsigned int v24; // eax@1 | |
1606 unsigned int v25; // eax@1 | |
1607 unsigned int v26; // eax@1 | |
1608 unsigned int v27; // eax@1 | |
1609 unsigned int v28; // eax@1 | |
1610 unsigned int v29; // eax@1 | |
1611 unsigned int v30; // eax@1 | |
1612 unsigned int v31; // eax@1 | |
1613 unsigned int v32; // eax@1 | |
1614 unsigned int v33; // eax@1 | |
1615 unsigned int v34; // eax@1 | |
1616 unsigned int v35; // eax@1 | |
1617 unsigned int v36; // eax@1 | |
1618 unsigned int v37; // eax@1 | |
1619 unsigned int v38; // eax@1 | |
1620 unsigned int v39; // eax@1 | |
1621 unsigned int v40; // eax@1 | |
1622 unsigned int v41; // eax@1 | |
1623 unsigned int v42; // eax@1 | |
1624 unsigned int v43; // eax@1 | |
1625 unsigned int v44; // eax@1 | |
1626 unsigned int v45; // eax@1 | |
1627 unsigned int v46; // eax@1 | |
1628 unsigned int v47; // eax@1 | |
1629 unsigned int v48; // eax@1 | |
1630 unsigned int v49; // eax@1 | |
1631 unsigned int v50; // eax@1 | |
1632 unsigned int v51; // eax@1 | |
1633 | |
1634 v1 = this; | |
1635 uTextureID_effpar1 = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT); | |
1636 uTextureID_effpar2 = pBitmaps_LOD->LoadTexture("effpar02", TEXTURE_DEFAULT); | |
1637 uTextureID_effpar3 = pBitmaps_LOD->LoadTexture("effpar03", TEXTURE_DEFAULT); | |
1638 uSpriteID_sp57c = pSprites_LOD->LoadSprite("sp57c", 6); | |
1639 v2 = pIconsFrameTable->FindIcon("zapp"); | |
1640 pIconsFrameTable->InitializeAnimation(v2); | |
1641 v3 = pIconsFrameTable->FindIcon("spheal1"); | |
1642 pIconsFrameTable->InitializeAnimation(v3); | |
1643 v4 = pIconsFrameTable->FindIcon("spheal2"); | |
1644 pIconsFrameTable->InitializeAnimation(v4); | |
1645 v5 = pIconsFrameTable->FindIcon("spheal3"); | |
1646 pIconsFrameTable->InitializeAnimation(v5); | |
1647 v6 = pIconsFrameTable->FindIcon("spboost1"); | |
1648 pIconsFrameTable->InitializeAnimation(v6); | |
1649 v7 = pIconsFrameTable->FindIcon("spboost2"); | |
1650 pIconsFrameTable->InitializeAnimation(v7); | |
1651 v8 = pIconsFrameTable->FindIcon("spboost3"); | |
1652 pIconsFrameTable->InitializeAnimation(v8); | |
1653 v9 = pIconsFrameTable->FindIcon("spell03"); | |
1654 pIconsFrameTable->InitializeAnimation(v9); | |
1655 v10 = pIconsFrameTable->FindIcon("spell05"); | |
1656 pIconsFrameTable->InitializeAnimation(v10); | |
1657 v11 = pIconsFrameTable->FindIcon("spell14"); | |
1658 pIconsFrameTable->InitializeAnimation(v11); | |
1659 v12 = pIconsFrameTable->FindIcon("spell17"); | |
1660 pIconsFrameTable->InitializeAnimation(v12); | |
1661 v13 = pIconsFrameTable->FindIcon("spell21"); | |
1662 pIconsFrameTable->InitializeAnimation(v13); | |
1663 v14 = pIconsFrameTable->FindIcon("spell25"); | |
1664 pIconsFrameTable->InitializeAnimation(v14); | |
1665 v15 = pIconsFrameTable->FindIcon("spell27"); | |
1666 pIconsFrameTable->InitializeAnimation(v15); | |
1667 v16 = pIconsFrameTable->FindIcon("spell36"); | |
1668 pIconsFrameTable->InitializeAnimation(v16); | |
1669 v17 = pIconsFrameTable->FindIcon("spell38"); | |
1670 pIconsFrameTable->InitializeAnimation(v17); | |
1671 v18 = pIconsFrameTable->FindIcon("spell46"); | |
1672 pIconsFrameTable->InitializeAnimation(v18); | |
1673 v19 = pIconsFrameTable->FindIcon("spell51"); | |
1674 pIconsFrameTable->InitializeAnimation(v19); | |
1675 v20 = pIconsFrameTable->FindIcon("spell55"); | |
1676 pIconsFrameTable->InitializeAnimation(v20); | |
1677 v21 = pIconsFrameTable->FindIcon("spell58"); | |
1678 pIconsFrameTable->InitializeAnimation(v21); | |
1679 v22 = pIconsFrameTable->FindIcon("spell69"); | |
1680 pIconsFrameTable->InitializeAnimation(v22); | |
1681 v23 = pIconsFrameTable->FindIcon("spell71"); | |
1682 pIconsFrameTable->InitializeAnimation(v23); | |
1683 v24 = pIconsFrameTable->FindIcon("spell73"); | |
1684 pIconsFrameTable->InitializeAnimation(v24); | |
1685 v25 = pIconsFrameTable->FindIcon("spell75"); | |
1686 pIconsFrameTable->InitializeAnimation(v25); | |
1687 v26 = pIconsFrameTable->FindIcon("spell96"); | |
1688 pIconsFrameTable->InitializeAnimation(v26); | |
1689 | |
1690 v27 = pSpriteFrameTable->FastFindSprite("spell01"); | |
1691 pSpriteFrameTable->InitializeSprite(v27); | |
1692 v28 = pSpriteFrameTable->FastFindSprite("spell02"); | |
1693 pSpriteFrameTable->InitializeSprite(v28); | |
1694 v29 = pSpriteFrameTable->FastFindSprite("spell03"); | |
1695 pSpriteFrameTable->InitializeSprite(v29); | |
1696 v30 = pSpriteFrameTable->FastFindSprite("spell09"); | |
1697 pSpriteFrameTable->InitializeSprite(v30); | |
1698 v31 = pSpriteFrameTable->FastFindSprite("spell11"); | |
1699 pSpriteFrameTable->InitializeSprite(v31); | |
1700 v32 = pSpriteFrameTable->FastFindSprite("spell18"); | |
1701 pSpriteFrameTable->InitializeSprite(v32); | |
1702 v33 = pSpriteFrameTable->FastFindSprite("spell22"); | |
1703 pSpriteFrameTable->InitializeSprite(v33); | |
1704 v34 = pSpriteFrameTable->FastFindSprite("spell26"); | |
1705 pSpriteFrameTable->InitializeSprite(v34); | |
1706 v35 = pSpriteFrameTable->FastFindSprite("spell29"); | |
1707 pSpriteFrameTable->InitializeSprite(v35); | |
1708 v36 = pSpriteFrameTable->FastFindSprite("spell39"); | |
1709 pSpriteFrameTable->InitializeSprite(v36); | |
1710 v37 = pSpriteFrameTable->FastFindSprite("spell39c"); | |
1711 pSpriteFrameTable->InitializeSprite(v37); | |
1712 v38 = pSpriteFrameTable->FastFindSprite("spell41"); | |
1713 pSpriteFrameTable->InitializeSprite(v38); | |
1714 v39 = pSpriteFrameTable->FastFindSprite("spell57c"); | |
1715 pSpriteFrameTable->InitializeSprite(v39); | |
1716 v40 = pSpriteFrameTable->FastFindSprite("spell62"); | |
1717 pSpriteFrameTable->InitializeSprite(v40); | |
1718 v41 = pSpriteFrameTable->FastFindSprite("spell65"); | |
1719 pSpriteFrameTable->InitializeSprite(v41); | |
1720 v42 = pSpriteFrameTable->FastFindSprite("spell66"); | |
1721 pSpriteFrameTable->InitializeSprite(v42); | |
1722 v43 = pSpriteFrameTable->FastFindSprite("spell70"); | |
1723 pSpriteFrameTable->InitializeSprite(v43); | |
1724 v44 = pSpriteFrameTable->FastFindSprite("spell76"); | |
1725 pSpriteFrameTable->InitializeSprite(v44); | |
1726 v45 = pSpriteFrameTable->FastFindSprite("spell84"); | |
1727 pSpriteFrameTable->InitializeSprite(v45); | |
1728 v46 = pSpriteFrameTable->FastFindSprite("spell90"); | |
1729 pSpriteFrameTable->InitializeSprite(v46); | |
1730 v47 = pSpriteFrameTable->FastFindSprite("spell92"); | |
1731 pSpriteFrameTable->InitializeSprite(v47); | |
1732 v48 = pSpriteFrameTable->FastFindSprite("spell93"); | |
1733 pSpriteFrameTable->InitializeSprite(v48); | |
1734 v49 = pSpriteFrameTable->FastFindSprite("spell97"); | |
1735 pSpriteFrameTable->InitializeSprite(v49); | |
1736 v50 = pSpriteFrameTable->FastFindSprite("spell97c"); | |
1737 pSpriteFrameTable->InitializeSprite(v50); | |
1738 v51 = pSpriteFrameTable->FastFindSprite("spell97c"); | |
1739 pSpriteFrameTable->InitializeSprite(v51); | |
1740 } |