comparison stru6.cpp @ 1390:613c77e51e38

Messed with spell effects drawing a bit.
author Nomad
date Thu, 18 Jul 2013 04:08:20 +0200
parents 0aeac0b9ca30
children 5930342f092b
comparison
equal deleted inserted replaced
1389:4dc34f7acb0b 1390:613c77e51e38
59 } 59 }
60 memcpy(pArray2, array_4EBBD0_x.data()/*array_4EBBD0*/, uNumVec3sInArray2 * sizeof(stru160)); 60 memcpy(pArray2, array_4EBBD0_x.data()/*array_4EBBD0*/, uNumVec3sInArray2 * sizeof(stru160));
61 } 61 }
62 62
63 //----- (0047829F) -------------------------------------------------------- 63 //----- (0047829F) --------------------------------------------------------
64 void stru6_stru1_indoor_sw_billboard::_47829F_fireball_collision(float arg0, float a3, float a4, float a5, int a2) 64 void stru6_stru1_indoor_sw_billboard::_47829F_sphere_particle(float x_offset, float y_offset, float z_offset, float scale, int diffuse)
65 { 65 {
66 stru6_stru1_indoor_sw_billboard *v6; // esi@1 66 int v7 = 0;
67 int v7; // edi@1 67
68 char *v8; // eax@2 68 for (unsigned int i = 0; i < uNumVec3sInArray2; ++i)
69 signed int v9; // ecx@2 69 {
70 int v10; // edx@3 70 for (unsigned int j = 0; j < 3; ++j)
71 signed int i; // [sp+8h] [bp-4h]@1 71 {
72 72 field_14[j].x = x_offset + scale * *(&pArray1->field_0 + 4 * *(int *)((char *)&pArray2->field_0 + v7));
73 auto a1 = this; 73 field_14[j].y = y_offset + scale * *(&pArray1->field_4 + 4 * *(int *)((char *)&pArray2->field_0 + v7));
74 74 field_14[j].z = z_offset + scale * *(&pArray1->field_8 + 4 * *(int *)((char *)&pArray2->field_0 + v7));
75 v6 = a1; 75 int v10 = *(int *)((char *)&pArray2->field_0 + v7);
76 v7 = 0; 76
77 for ( i = 0; i < (signed int)v6->uNumVec3sInArray2; ++i ) 77 field_14[j].diffuse = *((int *)&pArray1[1].field_0 + 4 * v10);
78 {
79 v8 = (char *)&v6->field_14[1];
80 v9 = 3;
81 do
82 {
83 *((float *)v8 - 1) = a5 * *(&v6->pArray1->field_0 + 4 * *(int *)((char *)&v6->pArray2->field_0 + v7)) + arg0;
84 *(float *)v8 = a5 * *(&v6->pArray1->field_4 + 4 * *(int *)((char *)&v6->pArray2->field_0 + v7)) + a3;
85 v8 += 16;
86 *((float *)v8 - 3) = a5 * *(&v6->pArray1->field_8 + 4 * *(int *)((char *)&v6->pArray2->field_0 + v7)) + a4;
87 v10 = *(int *)((char *)&v6->pArray2->field_0 + v7);
88 v7 += 4; 78 v7 += 4;
89 --v9; 79 }
90 *((int *)v8 - 2) = *((int *)&v6->pArray1[1].field_0 + 4 * v10); 80
91 } 81 uNumVertices = 3;
92 while ( v9 ); 82 if ( sub_477C61() && sub_477F63() )
93 v6->field_10 = 3; 83 {
94 if ( v6->sub_477C61() && v6->sub_477F63() ) 84 if ( sub_47802A() )
95 { 85 pRenderer->_4A4CC9_AddSomeBillboard(this, diffuse);
96 if ( v6->sub_47802A() )
97 pRenderer->_4A4CC9(v6, a2);
98 } 86 }
99 } 87 }
100 } 88 }
101 89
102 90
190 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; 178 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8;
191 local_0.uDiffuse = uDiffuse; 179 local_0.uDiffuse = uDiffuse;
192 local_0.x = x + 4.0; 180 local_0.x = x + 4.0;
193 local_0.y = v8; 181 local_0.y = v8;
194 local_0.z = v9; 182 local_0.z = v9;
195 local_0.flt_10 = 0.0; 183 local_0.r = 0.0;
196 local_0.flt_14 = 0.0; 184 local_0.g = 0.0;
197 local_0.flt_18 = 0.0; 185 local_0.b = 0.0;
198 local_0.timeToLive = (rand() & 0x40) + 96; 186 local_0.timeToLive = (rand() & 0x40) + 96;
199 local_0.uTextureID = uTextureID; 187 local_0.uTextureID = uTextureID;
200 local_0.flt_28 = 1.0; 188 local_0.flt_28 = 1.0;
201 pGame->pParticleEngine->AddParticle(&local_0); 189 pGame->pParticleEngine->AddParticle(&local_0);
202 local_0.x = x - 4.0; 190 local_0.x = x - 4.0;
221 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; 209 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8;
222 local_0.uDiffuse = uDiffuse; 210 local_0.uDiffuse = uDiffuse;
223 local_0.x = v10 + 4.0; 211 local_0.x = v10 + 4.0;
224 local_0.y = (double)a2->vPosition.y; 212 local_0.y = (double)a2->vPosition.y;
225 local_0.z = (double)a2->vPosition.z; 213 local_0.z = (double)a2->vPosition.z;
226 local_0.flt_10 = 0.0; 214 local_0.r = 0.0;
227 local_0.flt_14 = 0.0; 215 local_0.g = 0.0;
228 local_0.flt_18 = 0.0; 216 local_0.b = 0.0;
229 local_0.flt_28 = 1.0; 217 local_0.flt_28 = 1.0;
230 local_0.timeToLive = (rand() & 0x7F) + 128; 218 local_0.timeToLive = (rand() & 0x7F) + 128;
231 local_0.uTextureID = uTextureID; 219 local_0.uTextureID = uTextureID;
232 pGame->pParticleEngine->AddParticle(&local_0); 220 pGame->pParticleEngine->AddParticle(&local_0);
233 local_0.x = (double)a2->vPosition.x - 4.0; 221 local_0.x = (double)a2->vPosition.x - 4.0;
253 local_0.timeToLive = (rand() & 0x7F) + 128; 241 local_0.timeToLive = (rand() & 0x7F) + 128;
254 local_0.uTextureID = uTextureID; 242 local_0.uTextureID = uTextureID;
255 local_0.flt_28 = 1.0; 243 local_0.flt_28 = 1.0;
256 do 244 do
257 { 245 {
258 local_0.flt_10 = (double)(rand() & 0x1FF) - 255.0; 246 local_0.r = (double)(rand() & 0x1FF) - 255.0;
259 local_0.flt_14 = (double)(rand() & 0x1FF) - 255.0; 247 local_0.g = (double)(rand() & 0x1FF) - 255.0;
260 local_0.flt_18 = (double)(rand() & 0x1FF) - 255.0; 248 local_0.b = (double)(rand() & 0x1FF) - 255.0;
261 pGame->pParticleEngine->AddParticle(&local_0); 249 pGame->pParticleEngine->AddParticle(&local_0);
262 --v5; 250 --v5;
263 } 251 }
264 while ( v5 ); 252 while ( v5 );
265 } 253 }
266 254
267 //----- (004A7688) -------------------------------------------------------- 255 //----- (004A7688) --------------------------------------------------------
268 void stru6::_4A7688_fireball_collision_particle(SpriteObject *a2) 256 void stru6::_4A7688_fireball_collision_particle(SpriteObject *a2)
269 { 257 {
270 SpriteObject *v2; // esi@1
271 double v3; // st7@1 258 double v3; // st7@1
272 double v4; // st7@2 259 double v4; // st7@2
273 double v5; // st7@4
274 int v6; // eax@6 260 int v6; // eax@6
275 float v7; // ST0C_4@6 261 float v7; // ST0C_4@6
276 float v8; // ST08_4@6 262 float v8; // ST08_4@6
277 float v9; // ST04_4@6 263 float v9; // ST04_4@6
278 float v10; // ST00_4@6 264 float v10; // ST00_4@6
279 Particle_sw local_0; // [sp+1Ch] [bp-7Ch]@1 265 Particle_sw local_0; // [sp+1Ch] [bp-7Ch]@1
280 stru6 *v12; // [sp+84h] [bp-14h]@1
281 float v13; // [sp+88h] [bp-10h]@1 266 float v13; // [sp+88h] [bp-10h]@1
282 double v14; // [sp+8Ch] [bp-Ch]@5 267
283 float v15; // [sp+94h] [bp-4h]@4
284 signed int i; // [sp+A0h] [bp+8h]@4
285 signed int a2b; // [sp+A0h] [bp+8h]@6
286
287 v12 = this;
288 memset(&local_0, 0, 0x68u); 268 memset(&local_0, 0, 0x68u);
289 v2 = a2; 269
290 v3 = (double)a2->uSpriteFrameID / (double)pObjectList->pObjects[a2->uObjectDescID].uLifetime; 270 v3 = (double)a2->uSpriteFrameID / (double)pObjectList->pObjects[a2->uObjectDescID].uLifetime;
291 v13 = 512.0 * v3; 271 v13 = 512.0 * v3;
292 if ( v3 >= 0.75 ) 272 if ( v3 >= 0.75 )
293 v4 = (1.0 - v3) * 4.0; 273 v4 = (1.0 - v3) * 4.0;
294 else 274 else
295 v4 = v3 * 1.333333333333333; 275 v4 = v3 * 1.333333333333333;
296 v15 = v4; 276
297 v5 = (double)a2->vPosition.x;
298 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_1; 277 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_1;
299 local_0.uDiffuse = 0xFF3C1E; 278 local_0.uDiffuse = 0xFF3C1E;
300 local_0.x = v5; 279 local_0.x = (double)a2->vPosition.x;
301 local_0.y = (double)a2->vPosition.y; 280 local_0.y = (double)a2->vPosition.y;
302 local_0.z = (double)a2->vPosition.z; 281 local_0.z = (double)a2->vPosition.z;
303 local_0.timeToLive = (rand() & 0x7F) + 128; 282 local_0.timeToLive = (rand() & 0x7F) + 128;
304 local_0.uTextureID = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT); 283 local_0.uTextureID = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT);
305 i = 10;
306 local_0.flt_28 = 1.0; 284 local_0.flt_28 = 1.0;
307 do 285
308 { 286 // 10 fireball sparks
309 HIDWORD(v14) = rand() & 0x1FF; 287 for (unsigned int i = 0; i < 10; ++i)
310 local_0.flt_10 = (double)SHIDWORD(v14) - 255.0; 288 {
311 HIDWORD(v14) = rand() & 0x1FF; 289 local_0.r = (rand() & 0x1FF) - 255;
312 local_0.flt_14 = (double)SHIDWORD(v14) - 255.0; 290 local_0.g = (rand() & 0x1FF) - 255;
313 WORD2(v14) = rand() & 0x1FF; 291 local_0.b = (rand() & 0x1FF) - 255;
314 HIDWORD(v14) = WORD2(v14);
315 local_0.flt_18 = (double)WORD2(v14) - 255.0;
316 pGame->pParticleEngine->AddParticle(&local_0); 292 pGame->pParticleEngine->AddParticle(&local_0);
317 --i; 293 }
318 } 294
319 while ( i ); 295 v6 = ModulateColor(0xFF3C1E, v4);
320 v14 = v13 + 6.7553994e15; 296 v7 = (double)floorf(0.5f + v13);
321 a2b = LODWORD(v14); 297 v8 = (double)a2->vPosition.z;
322 v6 = sub_4A7063(0xFF3C1Eu, v15); 298 v9 = (double)a2->vPosition.y;
323 v7 = (double)a2b; 299 v10 = (double)a2->vPosition.x;
324 v8 = (double)v2->vPosition.z; 300 pStru1->_47829F_sphere_particle(v10, v9, v8, v7, v6);
325 v9 = (double)v2->vPosition.y;
326 v10 = (double)v2->vPosition.x;
327 v12->pStru1->_47829F_fireball_collision(v10, v9, v8, v7, v6);
328 } 301 }
329 302
330 //----- (004A77FD) -------------------------------------------------------- 303 //----- (004A77FD) --------------------------------------------------------
331 void stru6::_4A77FD_some_stuff_d3d(SpriteObject *a1) 304 void stru6::_4A77FD_implosion_particle(SpriteObject *a1)
332 { 305 {
333 SpriteObject *v2; // esi@1
334 stru6 *v3; // edi@1
335 double v4; // st7@1 306 double v4; // st7@1
336 double v5; // st7@2 307 double v5; // st7@2
337 double v6; // ST1C_8@4
338 int v7; // eax@4 308 int v7; // eax@4
339 float v8; // ST0C_4@4 309 float v8; // ST0C_4@4
340 float v9; // ST08_4@4 310 float v9; // ST08_4@4
341 float v10; // ST04_4@4 311 float v10; // ST04_4@4
342 float v11; // ST00_4@4 312 float v11; // ST00_4@4
343 float v12; // [sp+28h] [bp-4h]@1 313 float v12; // [sp+28h] [bp-4h]@1
344 float a1a; // [sp+34h] [bp+8h]@4 314
345
346 v2 = a1;
347 v3 = this;
348 v4 = (double)a1->uSpriteFrameID / (double)pObjectList->pObjects[a1->uObjectDescID].uLifetime; 315 v4 = (double)a1->uSpriteFrameID / (double)pObjectList->pObjects[a1->uObjectDescID].uLifetime;
349 v12 = 512.0 - v4 * 512.0; 316 v12 = 512.0 - v4 * 512.0;
350 if ( v4 >= 0.75 ) 317 if ( v4 >= 0.75 )
351 v5 = v4 * 4.0; 318 v5 = v4 * 4.0;
352 else 319 else
353 v5 = v4 * 1.333333333333333; 320 v5 = v4 * 1.333333333333333;
354 a1a = v5; 321
355 v6 = v12 + 6.7553994e15; 322 v7 = ModulateColor(0x7E7E7E, v5);
356 v7 = sub_4A7063(0x7E7E7Eu, a1a); 323 v8 = (double)floorf(0.5f + v12);
357 v8 = (double)SLODWORD(v6); 324 v9 = (double)a1->vPosition.z;
358 v9 = (double)v2->vPosition.z; 325 v10 = (double)a1->vPosition.y;
359 v10 = (double)v2->vPosition.y; 326 v11 = (double)a1->vPosition.x;
360 v11 = (double)v2->vPosition.x; 327 pStru1->_47829F_sphere_particle(v11, v10, v9, v8, v7);
361 v3->pStru1->_47829F_fireball_collision(v11, v10, v9, v8, v7);
362 } 328 }
363 329
364 //----- (004A78AE) -------------------------------------------------------- 330 //----- (004A78AE) --------------------------------------------------------
365 void stru6::_4A78AE_sparks_spell(SpriteObject *a1) 331 void stru6::_4A78AE_sparks_spell(SpriteObject *a1)
366 { 332 {
377 local_0.type = ParticleType_Sprite; 343 local_0.type = ParticleType_Sprite;
378 local_0.uDiffuse = 0x7F7F7F; 344 local_0.uDiffuse = 0x7F7F7F;
379 local_0.timeToLive = 1; 345 local_0.timeToLive = 1;
380 local_0.y = v4; 346 local_0.y = v4;
381 local_0.z = (double)a1->vPosition.z; 347 local_0.z = (double)a1->vPosition.z;
382 local_0.flt_10 = 0.0; 348 local_0.r = 0.0;
383 local_0.flt_14 = 0.0; 349 local_0.g = 0.0;
384 local_0.flt_18 = 0.0; 350 local_0.b = 0.0;
385 local_0.uTextureID = pSpriteFrameTable->GetFrame(v2->uSpriteID, v3)->pHwSpriteIDs[0]; 351 local_0.uTextureID = pSpriteFrameTable->GetFrame(v2->uSpriteID, v3)->pHwSpriteIDs[0];
386 LODWORD(local_0.flt_28) = 0x40000000u; 352 LODWORD(local_0.flt_28) = 0x40000000u;
387 pGame->pParticleEngine->AddParticle(&local_0); 353 pGame->pParticleEngine->AddParticle(&local_0);
388 } 354 }
389 355
411 v6 = 10; 377 v6 = 10;
412 Dst.flt_28 = 1.0; 378 Dst.flt_28 = 1.0;
413 Dst.timeToLive = (v5 & 0x7F) + 128; 379 Dst.timeToLive = (v5 & 0x7F) + 128;
414 do 380 do
415 { 381 {
416 Dst.flt_10 = (double)(rand() & 0x1FF) - 255.0; 382 Dst.r = (double)(rand() & 0x1FF) - 255.0;
417 Dst.flt_14 = (double)(rand() & 0x1FF) - 255.0; 383 Dst.g = (double)(rand() & 0x1FF) - 255.0;
418 Dst.flt_18 = (double)(rand() & 0x1FF) - 255.0; 384 Dst.b = (double)(rand() & 0x1FF) - 255.0;
419 pGame->pParticleEngine->AddParticle(&Dst); 385 pGame->pParticleEngine->AddParticle(&Dst);
420 --v6; 386 --v6;
421 } 387 }
422 while ( v6 ); 388 while ( v6 );
423 } 389 }
464 local_0.flt_28 = 1.0; 430 local_0.flt_28 = 1.0;
465 v7 = 0.0 * a4; 431 v7 = 0.0 * a4;
466 local_0.timeToLive = (v6 & 0x7F) + 128; 432 local_0.timeToLive = (v6 & 0x7F) + 128;
467 local_0.uTextureID = uTextureID; 433 local_0.uTextureID = uTextureID;
468 a1a = v7; 434 a1a = v7;
469 local_0.flt_10 = v7; 435 local_0.r = v7;
470 local_0.flt_14 = a4; 436 local_0.g = a4;
471 local_0.flt_18 = a4; 437 local_0.b = a4;
472 pGame->pParticleEngine->AddParticle(&local_0); 438 pGame->pParticleEngine->AddParticle(&local_0);
473 v8 = 0.70710677 * a4; 439 v8 = 0.70710677 * a4;
474 uDiffusea = v8; 440 uDiffusea = v8;
475 local_0.flt_10 = v8; 441 local_0.r = v8;
476 local_0.flt_14 = v8; 442 local_0.g = v8;
477 local_0.flt_18 = a4; 443 local_0.b = a4;
478 pGame->pParticleEngine->AddParticle(&local_0); 444 pGame->pParticleEngine->AddParticle(&local_0);
479 local_0.flt_14 = a1a; 445 local_0.g = a1a;
480 local_0.flt_10 = a4; 446 local_0.r = a4;
481 local_0.flt_18 = a4; 447 local_0.b = a4;
482 pGame->pParticleEngine->AddParticle(&local_0); 448 pGame->pParticleEngine->AddParticle(&local_0);
483 local_0.flt_10 = uDiffusea; 449 local_0.r = uDiffusea;
484 local_0.flt_18 = a4; 450 local_0.b = a4;
485 v9 = -uDiffusea; 451 v9 = -uDiffusea;
486 uTextureIDa = v9; 452 uTextureIDa = v9;
487 local_0.flt_14 = v9; 453 local_0.g = v9;
488 pGame->pParticleEngine->AddParticle(&local_0); 454 pGame->pParticleEngine->AddParticle(&local_0);
489 v10 = -1.0 * a4; 455 v10 = -1.0 * a4;
490 local_0.flt_10 = a1a; 456 local_0.r = a1a;
491 v12 = v10; 457 v12 = v10;
492 local_0.flt_14 = v10; 458 local_0.g = v10;
493 local_0.flt_18 = a4; 459 local_0.b = a4;
494 pGame->pParticleEngine->AddParticle(&local_0); 460 pGame->pParticleEngine->AddParticle(&local_0);
495 local_0.flt_18 = a4; 461 local_0.b = a4;
496 local_0.flt_10 = uTextureIDa; 462 local_0.r = uTextureIDa;
497 local_0.flt_14 = uTextureIDa; 463 local_0.g = uTextureIDa;
498 pGame->pParticleEngine->AddParticle(&local_0); 464 pGame->pParticleEngine->AddParticle(&local_0);
499 local_0.flt_10 = v12; 465 local_0.r = v12;
500 local_0.flt_14 = a1a; 466 local_0.g = a1a;
501 local_0.flt_18 = a4; 467 local_0.b = a4;
502 pGame->pParticleEngine->AddParticle(&local_0); 468 pGame->pParticleEngine->AddParticle(&local_0);
503 local_0.flt_10 = uTextureIDa; 469 local_0.r = uTextureIDa;
504 local_0.flt_14 = uDiffusea; 470 local_0.g = uDiffusea;
505 local_0.flt_18 = a4; 471 local_0.b = a4;
506 pGame->pParticleEngine->AddParticle(&local_0); 472 pGame->pParticleEngine->AddParticle(&local_0);
507 } 473 }
508 474
509 //----- (004A7C07) -------------------------------------------------------- 475 //----- (004A7C07) --------------------------------------------------------
510 void stru6::_4A7C07(SpriteObject *a2) 476 void stru6::_4A7C07(SpriteObject *a2)
538 local_0.uDiffuse = 0xFFFFFF; 504 local_0.uDiffuse = 0xFFFFFF;
539 a2a = v9; 505 a2a = v9;
540 local_0.x = v7; 506 local_0.x = v7;
541 local_0.z = a2a; 507 local_0.z = a2a;
542 local_0.y = v8; 508 local_0.y = v8;
543 local_0.flt_10 = 0.0; 509 local_0.r = 0.0;
544 local_0.flt_14 = 0.0; 510 local_0.g = 0.0;
545 local_0.flt_18 = 0.0; 511 local_0.b = 0.0;
546 v10 = rand(); 512 v10 = rand();
547 LODWORD(local_0.flt_28) = 0x40400000u; 513 LODWORD(local_0.flt_28) = 0x40400000u;
548 local_0.timeToLive = (v10 & 0x3F) + 64; 514 local_0.timeToLive = (v10 & 0x3F) + 64;
549 local_0.uTextureID = pSpriteFrameTable->GetFrame(v5->uSpriteID, v3->uSpriteFrameID)->pHwSpriteIDs[0]; 515 local_0.uTextureID = pSpriteFrameTable->GetFrame(v5->uSpriteID, v3->uSpriteFrameID)->pHwSpriteIDs[0];
550 pGame->pParticleEngine->AddParticle(&local_0); 516 pGame->pParticleEngine->AddParticle(&local_0);
570 local_0.uDiffuse = 0xFFFFFF; 536 local_0.uDiffuse = 0xFFFFFF;
571 LODWORD(local_0.flt_28) = 0x40000000u; 537 LODWORD(local_0.flt_28) = 0x40000000u;
572 local_0.x = v12; 538 local_0.x = v12;
573 local_0.y = (double)a2->vPosition.y; 539 local_0.y = (double)a2->vPosition.y;
574 local_0.z = (double)a2->vPosition.z; 540 local_0.z = (double)a2->vPosition.z;
575 local_0.flt_10 = 0.0; 541 local_0.r = 0.0;
576 local_0.flt_14 = 0.0; 542 local_0.g = 0.0;
577 local_0.flt_18 = 0.0; 543 local_0.b = 0.0;
578 local_0.timeToLive = (rand() & 0x3F) + 64; 544 local_0.timeToLive = (rand() & 0x3F) + 64;
579 local_0.uTextureID = pSpriteFrameTable->GetFrame(v5->uSpriteID, a2->uSpriteFrameID)->pHwSpriteIDs[0]; 545 local_0.uTextureID = pSpriteFrameTable->GetFrame(v5->uSpriteID, a2->uSpriteFrameID)->pHwSpriteIDs[0];
580 pGame->pParticleEngine->AddParticle(&local_0); 546 pGame->pParticleEngine->AddParticle(&local_0);
581 } 547 }
582 } 548 }
583 549
584 //----- (004A7E05) -------------------------------------------------------- 550 //----- (004A7E05) --------------------------------------------------------
585 void stru6::AddProjectile(SpriteObject *a2, int a3, unsigned int uTextureID) 551 void stru6::AddProjectile(SpriteObject *a2, int a3, unsigned int uTextureID)
586 { 552 {
587 int v4; // edx@1 553 if (a2->field_54)
588 float v5; // ST14_4@2 554 {
589 float v6; // ST10_4@2 555 DoAddProjectile(array_4[a2->field_54 & 0x1F].flt_0_x,
590 float v7; // ST0C_4@2 556 array_4[a2->field_54 & 0x1F].flt_4_y,
591 557 array_4[a2->field_54 & 0x1F].flt_8_z,
592 v4 = a2->field_54; 558 a2->vPosition.x,
593 if ( v4 ) 559 a2->vPosition.y,
594 { 560 a2->vPosition.z,
595 v5 = (double)a2->vPosition.z; 561 uTextureID);
596 v6 = (double)a2->vPosition.y;
597 v7 = (double)a2->vPosition.x;
598 DoAddProjectile(
599 this->array_4[v4 & 0x1F].flt_0_x,
600 this->array_4[v4 & 0x1F].flt_4_y,
601 this->array_4[v4 & 0x1F].flt_8_z,
602 v7,
603 v6,
604 v5,
605 uTextureID);
606 } 562 }
607 else 563 else
608 { 564 {
609 a2->field_54 = this->field_0++; 565 a2->field_54 = field_0++;
610 this->array_4[a2->field_54 & 0x1F].flt_0_x = (double)a2->vPosition.x; 566 array_4[a2->field_54 & 0x1F].flt_0_x = (double)a2->vPosition.x;
611 this->array_4[a2->field_54 & 0x1F].flt_4_y = (double)a2->vPosition.y; 567 array_4[a2->field_54 & 0x1F].flt_4_y = (double)a2->vPosition.y;
612 this->array_4[a2->field_54 & 0x1F].flt_8_z = (double)a2->vPosition.z; 568 array_4[a2->field_54 & 0x1F].flt_8_z = (double)a2->vPosition.z;
613 } 569 }
614 } 570 }
615 571
616 //----- (004A7E89) -------------------------------------------------------- 572 //----- (004A7E89) --------------------------------------------------------
617 void stru6::_4A7E89_sparkles_on_actor_after_it_casts_buff(Actor *pActor, unsigned int uDiffuse) 573 void stru6::_4A7E89_sparkles_on_actor_after_it_casts_buff(Actor *pActor, unsigned int uDiffuse)
685 local_0.x = v8 * 40.0 - 20.0 + v12; 641 local_0.x = v8 * 40.0 - 20.0 + v12;
686 v9 = pRnd->GetRandom(); 642 v9 = pRnd->GetRandom();
687 z1 = (double)z; 643 z1 = (double)z;
688 local_0.z = z1; 644 local_0.z = z1;
689 local_0.y = v9 * 40.0 - 20.0 + v11; 645 local_0.y = v9 * 40.0 - 20.0 + v11;
690 local_0.flt_10 = pRnd->GetRandom() * 400.0 - 200.0; 646 local_0.r = pRnd->GetRandom() * 400.0 - 200.0;
691 local_0.flt_14 = pRnd->GetRandom() * 400.0 - 200.0; 647 local_0.g = pRnd->GetRandom() * 400.0 - 200.0;
692 local_0.flt_18 = pRnd->GetRandom() * 150.0 + 50.0; 648 local_0.b = pRnd->GetRandom() * 150.0 + 50.0;
693 pGame->pParticleEngine->AddParticle(&local_0); 649 pGame->pParticleEngine->AddParticle(&local_0);
694 --v6; 650 --v6;
695 } 651 }
696 while ( v6 ); 652 while ( v6 );
697 } 653 }
729 } 685 }
730 686
731 //----- (004A80DC) -------------------------------------------------------- 687 //----- (004A80DC) --------------------------------------------------------
732 void stru6::_4A80DC_some_stuff_sw(SpriteObject *a2) 688 void stru6::_4A80DC_some_stuff_sw(SpriteObject *a2)
733 { 689 {
734 stru6 *v2; // esi@1
735 signed int v3; // ebx@1 690 signed int v3; // ebx@1
736 Particle_sw local_0; // [sp+Ch] [bp-68h]@1 691 Particle_sw local_0; // [sp+Ch] [bp-68h]@1
737 692
738 v2 = this;
739 memset(&local_0, 0, 0x68u); 693 memset(&local_0, 0, 0x68u);
740 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_1; 694 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_1;
741 local_0.uDiffuse = 0x7E7E7E; 695 local_0.uDiffuse = 0x7E7E7E;
742 local_0.timeToLive = (rand() & 0x7F) + 128; 696 local_0.timeToLive = (rand() & 0x7F) + 128;
743 local_0.uTextureID = v2->uTextureID_effpar1; 697 local_0.uTextureID = uTextureID_effpar1;
744 v3 = 8; 698 v3 = 8;
745 local_0.flt_28 = 1.0; 699 local_0.flt_28 = 1.0;
746 do 700 do
747 { 701 {
748 local_0.x = pRnd->GetRandom() * 40.0 + (double)a2->vPosition.x - 20.0; 702 local_0.x = pRnd->GetRandom() * 40.0 + (double)a2->vPosition.x - 20.0;
749 local_0.y = pRnd->GetRandom() * 40.0 + (double)a2->vPosition.y - 20.0; 703 local_0.y = pRnd->GetRandom() * 40.0 + (double)a2->vPosition.y - 20.0;
750 local_0.z = (double)a2->vPosition.z; 704 local_0.z = (double)a2->vPosition.z;
751 local_0.flt_10 = pRnd->GetRandom() * 800.0 - 400.0; 705 local_0.r = pRnd->GetRandom() * 800.0 - 400.0;
752 local_0.flt_14 = pRnd->GetRandom() * 800.0 - 400.0; 706 local_0.g = pRnd->GetRandom() * 800.0 - 400.0;
753 local_0.flt_18 = pRnd->GetRandom() * 350.0 + 50.0; 707 local_0.b = pRnd->GetRandom() * 350.0 + 50.0;
754 pGame->pParticleEngine->AddParticle(&local_0); 708 pGame->pParticleEngine->AddParticle(&local_0);
755 --v3; 709 --v3;
756 } 710 }
757 while ( v3 ); 711 while ( v3 );
758 } 712 }
1046 if ( result <= 2079 ) 1000 if ( result <= 2079 )
1047 return false; 1001 return false;
1048 if ( result <= 2081 ) 1002 if ( result <= 2081 )
1049 { 1003 {
1050 if ( pRenderer->pRenderD3D ) 1004 if ( pRenderer->pRenderD3D )
1051 _4A77FD_some_stuff_d3d(a2); 1005 _4A77FD_implosion_particle(a2);
1052 else 1006 else
1053 _4A80DC_some_stuff_sw(a2); 1007 _4A80DC_some_stuff_sw(a2);
1054 return false; 1008 return false;
1055 } 1009 }
1056 v9 = result == 2100; 1010 v9 = result == 2100;
1397 } 1351 }
1398 1352
1399 //----- (004A8BFC) -------------------------------------------------------- 1353 //----- (004A8BFC) --------------------------------------------------------
1400 int stru6::_4A8BFC() 1354 int stru6::_4A8BFC()
1401 { 1355 {
1402 stru6 *v1; // esi@1 1356 uAnimLength = 8 * pSpriteFrameTable->pSpriteSFrames[pSpriteFrameTable->FastFindSprite("spell84")].uAnimLength;
1403 int result; // eax@1 1357 return uAnimLength;
1404
1405 v1 = this;
1406 result = 8
1407 * pSpriteFrameTable->pSpriteSFrames[pSpriteFrameTable->FastFindSprite("spell84")].uAnimLength;
1408 v1->uAnimLength = result;
1409 return result;
1410 } 1358 }
1411 1359
1412 //----- (004A8C27) -------------------------------------------------------- 1360 //----- (004A8C27) --------------------------------------------------------
1413 void stru6::RenderSpecialEffects() 1361 void stru6::RenderSpecialEffects()
1414 { 1362 {
1578 } 1526 }
1579 1527
1580 //----- (004A90A0) -------------------------------------------------------- 1528 //----- (004A90A0) --------------------------------------------------------
1581 void stru6::LoadAnimations() 1529 void stru6::LoadAnimations()
1582 { 1530 {
1583 stru6 *v1; // esi@1
1584 unsigned int v2; // eax@1
1585 unsigned int v3; // eax@1
1586 unsigned int v4; // eax@1
1587 unsigned int v5; // eax@1
1588 unsigned int v6; // eax@1
1589 unsigned int v7; // eax@1
1590 unsigned int v8; // eax@1
1591 unsigned int v9; // eax@1
1592 unsigned int v10; // eax@1
1593 unsigned int v11; // eax@1
1594 unsigned int v12; // eax@1
1595 unsigned int v13; // eax@1
1596 unsigned int v14; // eax@1
1597 unsigned int v15; // eax@1
1598 unsigned int v16; // eax@1
1599 unsigned int v17; // eax@1
1600 unsigned int v18; // eax@1
1601 unsigned int v19; // eax@1
1602 unsigned int v20; // eax@1
1603 unsigned int v21; // eax@1
1604 unsigned int v22; // eax@1
1605 unsigned int v23; // eax@1
1606 unsigned int v24; // eax@1
1607 unsigned int v25; // eax@1
1608 unsigned int v26; // eax@1
1609 unsigned int v27; // eax@1
1610 unsigned int v28; // eax@1
1611 unsigned int v29; // eax@1
1612 unsigned int v30; // eax@1
1613 unsigned int v31; // eax@1
1614 unsigned int v32; // eax@1
1615 unsigned int v33; // eax@1
1616 unsigned int v34; // eax@1
1617 unsigned int v35; // eax@1
1618 unsigned int v36; // eax@1
1619 unsigned int v37; // eax@1
1620 unsigned int v38; // eax@1
1621 unsigned int v39; // eax@1
1622 unsigned int v40; // eax@1
1623 unsigned int v41; // eax@1
1624 unsigned int v42; // eax@1
1625 unsigned int v43; // eax@1
1626 unsigned int v44; // eax@1
1627 unsigned int v45; // eax@1
1628 unsigned int v46; // eax@1
1629 unsigned int v47; // eax@1
1630 unsigned int v48; // eax@1
1631 unsigned int v49; // eax@1
1632 unsigned int v50; // eax@1
1633 unsigned int v51; // eax@1
1634
1635 v1 = this;
1636 uTextureID_effpar1 = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT); 1531 uTextureID_effpar1 = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT);
1637 uTextureID_effpar2 = pBitmaps_LOD->LoadTexture("effpar02", TEXTURE_DEFAULT); 1532 uTextureID_effpar2 = pBitmaps_LOD->LoadTexture("effpar02", TEXTURE_DEFAULT);
1638 uTextureID_effpar3 = pBitmaps_LOD->LoadTexture("effpar03", TEXTURE_DEFAULT); 1533 uTextureID_effpar3 = pBitmaps_LOD->LoadTexture("effpar03", TEXTURE_DEFAULT);
1639 uSpriteID_sp57c = pSprites_LOD->LoadSprite("sp57c", 6); 1534 uSpriteID_sp57c = pSprites_LOD->LoadSprite("sp57c", 6);
1640 v2 = pIconsFrameTable->FindIcon("zapp"); 1535
1641 pIconsFrameTable->InitializeAnimation(v2); 1536 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("zapp"));
1642 v3 = pIconsFrameTable->FindIcon("spheal1"); 1537 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spheal1"));
1643 pIconsFrameTable->InitializeAnimation(v3); 1538 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spheal2"));
1644 v4 = pIconsFrameTable->FindIcon("spheal2"); 1539 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spheal3"));
1645 pIconsFrameTable->InitializeAnimation(v4); 1540 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spboost1"));
1646 v5 = pIconsFrameTable->FindIcon("spheal3"); 1541 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spboost2"));
1647 pIconsFrameTable->InitializeAnimation(v5); 1542 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spboost3"));
1648 v6 = pIconsFrameTable->FindIcon("spboost1"); 1543 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell03"));
1649 pIconsFrameTable->InitializeAnimation(v6); 1544 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell05"));
1650 v7 = pIconsFrameTable->FindIcon("spboost2"); 1545 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell14"));
1651 pIconsFrameTable->InitializeAnimation(v7); 1546 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell17"));
1652 v8 = pIconsFrameTable->FindIcon("spboost3"); 1547 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell21"));
1653 pIconsFrameTable->InitializeAnimation(v8); 1548 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell25"));
1654 v9 = pIconsFrameTable->FindIcon("spell03"); 1549 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell27"));
1655 pIconsFrameTable->InitializeAnimation(v9); 1550 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell36"));
1656 v10 = pIconsFrameTable->FindIcon("spell05"); 1551 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell38"));
1657 pIconsFrameTable->InitializeAnimation(v10); 1552 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell46"));
1658 v11 = pIconsFrameTable->FindIcon("spell14"); 1553 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell51"));
1659 pIconsFrameTable->InitializeAnimation(v11); 1554 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell55"));
1660 v12 = pIconsFrameTable->FindIcon("spell17"); 1555 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell58"));
1661 pIconsFrameTable->InitializeAnimation(v12); 1556 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell69"));
1662 v13 = pIconsFrameTable->FindIcon("spell21"); 1557 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell71"));
1663 pIconsFrameTable->InitializeAnimation(v13); 1558 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell73"));
1664 v14 = pIconsFrameTable->FindIcon("spell25"); 1559 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell75"));
1665 pIconsFrameTable->InitializeAnimation(v14); 1560 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell96"));
1666 v15 = pIconsFrameTable->FindIcon("spell27"); 1561
1667 pIconsFrameTable->InitializeAnimation(v15); 1562 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell01"));
1668 v16 = pIconsFrameTable->FindIcon("spell36"); 1563 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell02"));
1669 pIconsFrameTable->InitializeAnimation(v16); 1564 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell03"));
1670 v17 = pIconsFrameTable->FindIcon("spell38"); 1565 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell09"));
1671 pIconsFrameTable->InitializeAnimation(v17); 1566 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell11"));
1672 v18 = pIconsFrameTable->FindIcon("spell46"); 1567 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell18"));
1673 pIconsFrameTable->InitializeAnimation(v18); 1568 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell22"));
1674 v19 = pIconsFrameTable->FindIcon("spell51"); 1569 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell26"));
1675 pIconsFrameTable->InitializeAnimation(v19); 1570 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell29"));
1676 v20 = pIconsFrameTable->FindIcon("spell55"); 1571 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell39"));
1677 pIconsFrameTable->InitializeAnimation(v20); 1572 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell39c"));
1678 v21 = pIconsFrameTable->FindIcon("spell58"); 1573 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell41"));
1679 pIconsFrameTable->InitializeAnimation(v21); 1574 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell57c"));
1680 v22 = pIconsFrameTable->FindIcon("spell69"); 1575 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell62"));
1681 pIconsFrameTable->InitializeAnimation(v22); 1576 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell65"));
1682 v23 = pIconsFrameTable->FindIcon("spell71"); 1577 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell66"));
1683 pIconsFrameTable->InitializeAnimation(v23); 1578 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell70"));
1684 v24 = pIconsFrameTable->FindIcon("spell73"); 1579 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell76"));
1685 pIconsFrameTable->InitializeAnimation(v24); 1580 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell84"));
1686 v25 = pIconsFrameTable->FindIcon("spell75"); 1581 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell90"));
1687 pIconsFrameTable->InitializeAnimation(v25); 1582 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell92"));
1688 v26 = pIconsFrameTable->FindIcon("spell96"); 1583 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell93"));
1689 pIconsFrameTable->InitializeAnimation(v26); 1584 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell97"));
1690 1585 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell97c"));
1691 v27 = pSpriteFrameTable->FastFindSprite("spell01"); 1586 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell97c"));
1692 pSpriteFrameTable->InitializeSprite(v27); 1587 }
1693 v28 = pSpriteFrameTable->FastFindSprite("spell02");
1694 pSpriteFrameTable->InitializeSprite(v28);
1695 v29 = pSpriteFrameTable->FastFindSprite("spell03");
1696 pSpriteFrameTable->InitializeSprite(v29);
1697 v30 = pSpriteFrameTable->FastFindSprite("spell09");
1698 pSpriteFrameTable->InitializeSprite(v30);
1699 v31 = pSpriteFrameTable->FastFindSprite("spell11");
1700 pSpriteFrameTable->InitializeSprite(v31);
1701 v32 = pSpriteFrameTable->FastFindSprite("spell18");
1702 pSpriteFrameTable->InitializeSprite(v32);
1703 v33 = pSpriteFrameTable->FastFindSprite("spell22");
1704 pSpriteFrameTable->InitializeSprite(v33);
1705 v34 = pSpriteFrameTable->FastFindSprite("spell26");
1706 pSpriteFrameTable->InitializeSprite(v34);
1707 v35 = pSpriteFrameTable->FastFindSprite("spell29");
1708 pSpriteFrameTable->InitializeSprite(v35);
1709 v36 = pSpriteFrameTable->FastFindSprite("spell39");
1710 pSpriteFrameTable->InitializeSprite(v36);
1711 v37 = pSpriteFrameTable->FastFindSprite("spell39c");
1712 pSpriteFrameTable->InitializeSprite(v37);
1713 v38 = pSpriteFrameTable->FastFindSprite("spell41");
1714 pSpriteFrameTable->InitializeSprite(v38);
1715 v39 = pSpriteFrameTable->FastFindSprite("spell57c");
1716 pSpriteFrameTable->InitializeSprite(v39);
1717 v40 = pSpriteFrameTable->FastFindSprite("spell62");
1718 pSpriteFrameTable->InitializeSprite(v40);
1719 v41 = pSpriteFrameTable->FastFindSprite("spell65");
1720 pSpriteFrameTable->InitializeSprite(v41);
1721 v42 = pSpriteFrameTable->FastFindSprite("spell66");
1722 pSpriteFrameTable->InitializeSprite(v42);
1723 v43 = pSpriteFrameTable->FastFindSprite("spell70");
1724 pSpriteFrameTable->InitializeSprite(v43);
1725 v44 = pSpriteFrameTable->FastFindSprite("spell76");
1726 pSpriteFrameTable->InitializeSprite(v44);
1727 v45 = pSpriteFrameTable->FastFindSprite("spell84");
1728 pSpriteFrameTable->InitializeSprite(v45);
1729 v46 = pSpriteFrameTable->FastFindSprite("spell90");
1730 pSpriteFrameTable->InitializeSprite(v46);
1731 v47 = pSpriteFrameTable->FastFindSprite("spell92");
1732 pSpriteFrameTable->InitializeSprite(v47);
1733 v48 = pSpriteFrameTable->FastFindSprite("spell93");
1734 pSpriteFrameTable->InitializeSprite(v48);
1735 v49 = pSpriteFrameTable->FastFindSprite("spell97");
1736 pSpriteFrameTable->InitializeSprite(v49);
1737 v50 = pSpriteFrameTable->FastFindSprite("spell97c");
1738 pSpriteFrameTable->InitializeSprite(v50);
1739 v51 = pSpriteFrameTable->FastFindSprite("spell97c");
1740 pSpriteFrameTable->InitializeSprite(v51);
1741 }