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