comparison stru6.cpp @ 45:bcc051713d20

BLV render & seffects
author Nomad
date Mon, 22 Oct 2012 20:45:14 +0200
parents 509744251c8e
children 5159d2e6f559
comparison
equal deleted inserted replaced
43:484492a6dd28 45:bcc051713d20
86 //----- (004A71FE) -------------------------------------------------------- 86 //----- (004A71FE) --------------------------------------------------------
87 void stru6::DoAddProjectile(float srcX, float srcY, float srcZ, float dstX, float dstY, float dstZ, unsigned int uTextureID) 87 void stru6::DoAddProjectile(float srcX, float srcY, float srcZ, float dstX, float dstY, float dstZ, unsigned int uTextureID)
88 { 88 {
89 int v8; // eax@1 89 int v8; // eax@1
90 90
91 v8 = this->uNumProjectiles; 91 v8 = uNumProjectiles;
92 if ( v8 != 32 ) 92 if ( v8 != 32 )
93 { 93 {
94 this->pProjectiles[v8].srcX = srcX; 94 pProjectiles[v8].srcX = srcX;
95 *((float *)&this->array_0[0].uSpellAnimLength + 7 * (this->uNumProjectiles + 21)) = srcY; 95 *((float *)&this->array_0[0].uSpellAnimLength + 7 * (uNumProjectiles + 21)) = srcY;
96 this->pProjectiles[this->uNumProjectiles].srcZ = srcZ; 96 pProjectiles[uNumProjectiles].srcZ = srcZ;
97 this->pProjectiles[this->uNumProjectiles].dstX = dstX; 97 pProjectiles[uNumProjectiles].dstX = dstX;
98 this->pProjectiles[this->uNumProjectiles].dstY = dstY; 98 pProjectiles[uNumProjectiles].dstY = dstY;
99 this->pProjectiles[this->uNumProjectiles].dstZ = dstZ; 99 pProjectiles[uNumProjectiles].dstZ = dstZ;
100 this->pProjectiles[this->uNumProjectiles++].uTextureID = uTextureID; 100 pProjectiles[uNumProjectiles++].uTextureID = uTextureID;
101 } 101 }
102 } 102 }
103 103
104 //----- (004A7298) -------------------------------------------------------- 104 //----- (004A7298) --------------------------------------------------------
105 int stru6::DrawProjectiles() 105 void stru6::DrawProjectiles()
106 { 106 {
107 stru6 *v1; // ebx@1
108 char *v2; // eax@1
109 signed int v3; // ecx@1
110 unsigned __int8 v4; // zf@3
111 unsigned __int8 v5; // sf@3
112 IndoorCameraD3D *v6; // edi@3
113 int result; // eax@3
114 int v8; // esi@4
115 int v9; // eax@5
116 float v10; // ST1C_4@8 107 float v10; // ST1C_4@8
117 float v11; // ST0C_4@8 108 float v11; // ST0C_4@8
118 IDirect3DTexture2 *v12; // [sp+20h] [bp-78h]@6 109 IDirect3DTexture2 *v12; // [sp+20h] [bp-78h]@6
119 RenderVertexSoft v13[2]; // [sp+30h] [bp-68h]@1 110 RenderVertexSoft v[2]; // [sp+30h] [bp-68h]@1
120 float v14; // [sp+90h] [bp-8h]@3 111
121 int v15; // [sp+94h] [bp-4h]@3 112 for (uint i = 0; i < uNumProjectiles; ++i)
122 113 {
123 v1 = this; 114 auto p = pProjectiles + i;
124 v2 = (char *)&v13[0].flt_2C; 115
125 v3 = 2; 116 v[0].vWorldPosition.x = p->srcX;
126 do 117 v[0].vWorldPosition.y = p->srcY;
127 { 118 v[0].vWorldPosition.z = p->srcZ;
128 *(float *)v2 = 0.0; 119 v[1].vWorldPosition.x = p->dstX;
129 v2 += 48; 120 v[1].vWorldPosition.y = p->dstY;
130 --v3; 121 v[1].vWorldPosition.z = p->dstZ;
131 } 122 pGame->pIndoorCameraD3D->ViewTransform(v, 2);
132 while ( v3 ); 123
133 v15 = 0; 124 sr_42620A(v);
134 v4 = v1->uNumProjectiles == 0; 125
135 v5 = v1->uNumProjectiles < 0; 126 pGame->pIndoorCameraD3D->_436BB7_project_and_stuff(v, 2, 0);
136 v6 = pGame->pIndoorCameraD3D; 127
137 result = LODWORD(v6->flt_D0); 128 if (p->uTextureID != -1)
138 v14 = v6->flt_D0; 129 v12 = pBitmaps_LOD->pHardwareTextures[p->uTextureID];
139 if ( !(v5 | v4) ) 130 else
140 { 131 v12 = 0;
141 v8 = (int)&v1->pProjectiles[0].srcY; 132
142 do 133 v10 = pGame->pIndoorCameraD3D->flt_D0 / v[1].vWorldViewPosition.x * 20.0;
143 { 134 v11 = pGame->pIndoorCameraD3D->flt_D0 / v[0].vWorldViewPosition.x * 20.0;
144 v13[0].vWorldPosition.x = *(float *)(v8 - 4); 135 pRenderer->DrawProjectile(
145 v13[0].vWorldPosition.y = *(float *)v8; 136 v[0].vWorldViewProjX,
146 v13[0].vWorldPosition.z = *(float *)(v8 + 4); 137 v[0].vWorldViewProjY,
147 v13[1].vWorldPosition.x = *(float *)(v8 + 8); 138 v[0].vWorldViewPosition.x,
148 v13[1].vWorldPosition.y = *(float *)(v8 + 12); 139 v11,
149 v13[1].vWorldPosition.z = *(float *)(v8 + 16); 140 v[1].vWorldViewProjX,
150 v6->ViewTransform(v13, 2u); 141 v[1].vWorldViewProjY,
151 sr_42620A(v13); 142 v[1].vWorldViewPosition.x,
152 v6->_436BB7_project_and_stuff(v13, 2u, 0); 143 v10,
153 v9 = *(int *)(v8 + 20); 144 v12);
154 if ( v9 == -1 ) 145 }
155 v12 = 0;
156 else
157 v12 = pBitmaps_LOD->pHardwareTextures[v9];
158 v10 = v14 / v13[1].vWorldViewPosition.x * 20.0;
159 v11 = v14 / v13[0].vWorldViewPosition.x * 20.0;
160 pRenderer->DrawProjectile(
161 v13[0].vWorldViewProjX,
162 v13[0].vWorldViewProjY,
163 v13[0].vWorldViewPosition.x,
164 v11,
165 v13[1].vWorldViewProjX,
166 v13[1].vWorldViewProjY,
167 v13[1].vWorldViewPosition.x,
168 v10,
169 v12);
170 ++v15;
171 v8 += 28;
172 result = v15;
173 }
174 while ( v15 < v1->uNumProjectiles );
175 }
176 return result;
177 } 146 }
178 147
179 //----- (004A73AA) -------------------------------------------------------- 148 //----- (004A73AA) --------------------------------------------------------
180 void stru6::_4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(LayingItem *a2, unsigned int uDiffuse, unsigned int uTextureID) 149 void stru6::_4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(LayingItem *a2, unsigned int uDiffuse, unsigned int uTextureID)
181 { 150 {
205 local_0.y = v8; 174 local_0.y = v8;
206 local_0.z = v9; 175 local_0.z = v9;
207 local_0.flt_10 = 0.0; 176 local_0.flt_10 = 0.0;
208 local_0.flt_14 = 0.0; 177 local_0.flt_14 = 0.0;
209 local_0.flt_18 = 0.0; 178 local_0.flt_18 = 0.0;
210 local_0.field_20 = (rand() & 0x40) + 96; 179 local_0.timeToLive = (rand() & 0x40) + 96;
211 local_0.uTextureID = uTextureID; 180 local_0.uTextureID = uTextureID;
212 local_0.flt_28 = 1.0; 181 local_0.flt_28 = 1.0;
213 pGame->pParticleEngine->AddParticle(&local_0); 182 pGame->pParticleEngine->AddParticle(&local_0);
214 local_0.x = x - 4.0; 183 local_0.x = x - 4.0;
215 pGame->pParticleEngine->AddParticle(&local_0); 184 pGame->pParticleEngine->AddParticle(&local_0);
237 local_0.z = (double)a2->vPosition.z; 206 local_0.z = (double)a2->vPosition.z;
238 local_0.flt_10 = 0.0; 207 local_0.flt_10 = 0.0;
239 local_0.flt_14 = 0.0; 208 local_0.flt_14 = 0.0;
240 local_0.flt_18 = 0.0; 209 local_0.flt_18 = 0.0;
241 local_0.flt_28 = 1.0; 210 local_0.flt_28 = 1.0;
242 local_0.field_20 = (rand() & 0x7F) + 128; 211 local_0.timeToLive = (rand() & 0x7F) + 128;
243 local_0.uTextureID = uTextureID; 212 local_0.uTextureID = uTextureID;
244 pGame->pParticleEngine->AddParticle(&local_0); 213 pGame->pParticleEngine->AddParticle(&local_0);
245 local_0.x = (double)a2->vPosition.x - 4.0; 214 local_0.x = (double)a2->vPosition.x - 4.0;
246 pGame->pParticleEngine->AddParticle(&local_0); 215 pGame->pParticleEngine->AddParticle(&local_0);
247 } 216 }
260 local_0.y = (double)a1->vPosition.y; 229 local_0.y = (double)a1->vPosition.y;
261 v4 = (double)a1->vPosition.z; 230 v4 = (double)a1->vPosition.z;
262 local_0.uDiffuse = uDiffuse; 231 local_0.uDiffuse = uDiffuse;
263 local_0.z = v4; 232 local_0.z = v4;
264 v5 = 10; 233 v5 = 10;
265 local_0.field_20 = (rand() & 0x7F) + 128; 234 local_0.timeToLive = (rand() & 0x7F) + 128;
266 local_0.uTextureID = uTextureID; 235 local_0.uTextureID = uTextureID;
267 local_0.flt_28 = 1.0; 236 local_0.flt_28 = 1.0;
268 do 237 do
269 { 238 {
270 local_0.flt_10 = (double)(rand() & 0x1FF) - 255.0; 239 local_0.flt_10 = (double)(rand() & 0x1FF) - 255.0;
310 local_0.bFree = 1029; 279 local_0.bFree = 1029;
311 local_0.uDiffuse = 0xFF3C1Eu; 280 local_0.uDiffuse = 0xFF3C1Eu;
312 local_0.x = v5; 281 local_0.x = v5;
313 local_0.y = (double)a2->vPosition.y; 282 local_0.y = (double)a2->vPosition.y;
314 local_0.z = (double)a2->vPosition.z; 283 local_0.z = (double)a2->vPosition.z;
315 local_0.field_20 = (rand() & 0x7F) + 128; 284 local_0.timeToLive = (rand() & 0x7F) + 128;
316 local_0.uTextureID = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT); 285 local_0.uTextureID = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT);
317 i = 10; 286 i = 10;
318 local_0.flt_28 = 1.0; 287 local_0.flt_28 = 1.0;
319 do 288 do
320 { 289 {
386 v3 = a1->uSpriteFrameID; 355 v3 = a1->uSpriteFrameID;
387 local_0.x = (double)a1->vPosition.x; 356 local_0.x = (double)a1->vPosition.x;
388 v4 = (double)a1->vPosition.y; 357 v4 = (double)a1->vPosition.y;
389 local_0.bFree = 2048; 358 local_0.bFree = 2048;
390 local_0.uDiffuse = 0x7F7F7Fu; 359 local_0.uDiffuse = 0x7F7F7Fu;
391 local_0.field_20 = 1; 360 local_0.timeToLive = 1;
392 local_0.y = v4; 361 local_0.y = v4;
393 local_0.z = (double)a1->vPosition.z; 362 local_0.z = (double)a1->vPosition.z;
394 local_0.flt_10 = 0.0; 363 local_0.flt_10 = 0.0;
395 local_0.flt_14 = 0.0; 364 local_0.flt_14 = 0.0;
396 local_0.flt_18 = 0.0; 365 local_0.flt_18 = 0.0;
420 Dst.z = (double)a1->vPosition.z; 389 Dst.z = (double)a1->vPosition.z;
421 Dst.uTextureID = pSpriteFrameTable->GetFrame(v2->uSpriteID, v3)->pHwSpriteIDs[0]; 390 Dst.uTextureID = pSpriteFrameTable->GetFrame(v2->uSpriteID, v3)->pHwSpriteIDs[0];
422 v5 = rand(); 391 v5 = rand();
423 v6 = 10; 392 v6 = 10;
424 Dst.flt_28 = 1.0; 393 Dst.flt_28 = 1.0;
425 Dst.field_20 = (v5 & 0x7F) + 128; 394 Dst.timeToLive = (v5 & 0x7F) + 128;
426 do 395 do
427 { 396 {
428 Dst.flt_10 = (double)(rand() & 0x1FF) - 255.0; 397 Dst.flt_10 = (double)(rand() & 0x1FF) - 255.0;
429 Dst.flt_14 = (double)(rand() & 0x1FF) - 255.0; 398 Dst.flt_14 = (double)(rand() & 0x1FF) - 255.0;
430 Dst.flt_18 = (double)(rand() & 0x1FF) - 255.0; 399 Dst.flt_18 = (double)(rand() & 0x1FF) - 255.0;
473 local_0.uDiffuse = uDiffuse; 442 local_0.uDiffuse = uDiffuse;
474 local_0.z = (double)(v5 + 32); 443 local_0.z = (double)(v5 + 32);
475 v6 = rand(); 444 v6 = rand();
476 local_0.flt_28 = 1.0; 445 local_0.flt_28 = 1.0;
477 v7 = 0.0 * a4; 446 v7 = 0.0 * a4;
478 local_0.field_20 = (v6 & 0x7F) + 128; 447 local_0.timeToLive = (v6 & 0x7F) + 128;
479 local_0.uTextureID = uTextureID; 448 local_0.uTextureID = uTextureID;
480 a1a = v7; 449 a1a = v7;
481 local_0.flt_10 = v7; 450 local_0.flt_10 = v7;
482 local_0.flt_14 = a4; 451 local_0.flt_14 = a4;
483 local_0.flt_18 = a4; 452 local_0.flt_18 = a4;
555 local_0.flt_10 = 0.0; 524 local_0.flt_10 = 0.0;
556 local_0.flt_14 = 0.0; 525 local_0.flt_14 = 0.0;
557 local_0.flt_18 = 0.0; 526 local_0.flt_18 = 0.0;
558 v10 = rand(); 527 v10 = rand();
559 LODWORD(local_0.flt_28) = 0x40400000u; 528 LODWORD(local_0.flt_28) = 0x40400000u;
560 local_0.field_20 = (v10 & 0x3F) + 64; 529 local_0.timeToLive = (v10 & 0x3F) + 64;
561 local_0.uTextureID = pSpriteFrameTable->GetFrame(v5->uSpriteID, v3->uSpriteFrameID)->pHwSpriteIDs[0]; 530 local_0.uTextureID = pSpriteFrameTable->GetFrame(v5->uSpriteID, v3->uSpriteFrameID)->pHwSpriteIDs[0];
562 pGame->pParticleEngine->AddParticle(&local_0); 531 pGame->pParticleEngine->AddParticle(&local_0);
563 v11 = (double)v3->vPosition.x; 532 v11 = (double)v3->vPosition.x;
564 LODWORD(local_0.flt_28) = 0x40800000u; 533 LODWORD(local_0.flt_28) = 0x40800000u;
565 local_0.x = v11; 534 local_0.x = v11;
566 local_0.y = (double)v3->vPosition.y; 535 local_0.y = (double)v3->vPosition.y;
567 local_0.z = (double)v3->vPosition.z; 536 local_0.z = (double)v3->vPosition.z;
568 local_0.field_20 = (rand() & 0x3F) + 64; 537 local_0.timeToLive = (rand() & 0x3F) + 64;
569 pGame->pParticleEngine->AddParticle(&local_0); 538 pGame->pParticleEngine->AddParticle(&local_0);
570 v2->array_0[v3->field_54 & 0x1F].flt_4 = (double)v3->vPosition.x; 539 v2->array_0[v3->field_54 & 0x1F].flt_4 = (double)v3->vPosition.x;
571 v2->array_0[v3->field_54 & 0x1F].flt_8 = (double)v3->vPosition.y; 540 v2->array_0[v3->field_54 & 0x1F].flt_8 = (double)v3->vPosition.y;
572 v2->array_0[v3->field_54 & 0x1F].flt_C = (double)v3->vPosition.z; 541 v2->array_0[v3->field_54 & 0x1F].flt_C = (double)v3->vPosition.z;
573 } 542 }
585 local_0.y = (double)a2->vPosition.y; 554 local_0.y = (double)a2->vPosition.y;
586 local_0.z = (double)a2->vPosition.z; 555 local_0.z = (double)a2->vPosition.z;
587 local_0.flt_10 = 0.0; 556 local_0.flt_10 = 0.0;
588 local_0.flt_14 = 0.0; 557 local_0.flt_14 = 0.0;
589 local_0.flt_18 = 0.0; 558 local_0.flt_18 = 0.0;
590 local_0.field_20 = (rand() & 0x3F) + 64; 559 local_0.timeToLive = (rand() & 0x3F) + 64;
591 local_0.uTextureID = pSpriteFrameTable->GetFrame(v5->uSpriteID, a2->uSpriteFrameID)->pHwSpriteIDs[0]; 560 local_0.uTextureID = pSpriteFrameTable->GetFrame(v5->uSpriteID, a2->uSpriteFrameID)->pHwSpriteIDs[0];
592 pGame->pParticleEngine->AddParticle(&local_0); 561 pGame->pParticleEngine->AddParticle(&local_0);
593 } 562 }
594 } 563 }
595 564
635 int v7; // [sp+74h] [bp-4h]@2 604 int v7; // [sp+74h] [bp-4h]@2
636 signed int pActora; // [sp+80h] [bp+8h]@1 605 signed int pActora; // [sp+80h] [bp+8h]@1
637 606
638 memset(&Dst, 0, 0x68u); 607 memset(&Dst, 0, 0x68u);
639 Dst.bFree = 1036; 608 Dst.bFree = 1036;
640 Dst.field_20 = (rand() & 0x7F) + 128; 609 Dst.timeToLive = (rand() & 0x7F) + 128;
641 v3 = pActor; 610 v3 = pActor;
642 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar02", TEXTURE_DEFAULT); 611 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar02", TEXTURE_DEFAULT);
643 pActora = 50; 612 pActora = 50;
644 Dst.flt_28 = 1.0; 613 Dst.flt_28 = 1.0;
645 do 614 do
685 local_0.bFree = 1029; 654 local_0.bFree = 1029;
686 local_0.uDiffuse = 0x7E7E7Eu; 655 local_0.uDiffuse = 0x7E7E7Eu;
687 v5 = rand(); 656 v5 = rand();
688 local_0.flt_28 = 1.0; 657 local_0.flt_28 = 1.0;
689 v6 = 8; 658 v6 = 8;
690 local_0.field_20 = (v5 & 0x7F) + 128; 659 local_0.timeToLive = (v5 & 0x7F) + 128;
691 v7 = v4->uTextureID_effpar1; 660 v7 = v4->uTextureID_effpar1;
692 v12 = (double)x; 661 v12 = (double)x;
693 local_0.uTextureID = v7; 662 local_0.uTextureID = v7;
694 v11 = (double)y; 663 v11 = (double)y;
695 do 664 do
750 719
751 v2 = this; 720 v2 = this;
752 memset(&local_0, 0, 0x68u); 721 memset(&local_0, 0, 0x68u);
753 local_0.bFree = 1029; 722 local_0.bFree = 1029;
754 local_0.uDiffuse = 0x7E7E7Eu; 723 local_0.uDiffuse = 0x7E7E7Eu;
755 local_0.field_20 = (rand() & 0x7F) + 128; 724 local_0.timeToLive = (rand() & 0x7F) + 128;
756 local_0.uTextureID = v2->uTextureID_effpar1; 725 local_0.uTextureID = v2->uTextureID_effpar1;
757 v3 = 8; 726 v3 = 8;
758 local_0.flt_28 = 1.0; 727 local_0.flt_28 = 1.0;
759 do 728 do
760 { 729 {
1487 v1->uAnimLength = result; 1456 v1->uAnimLength = result;
1488 return result; 1457 return result;
1489 } 1458 }
1490 1459
1491 //----- (004A8C27) -------------------------------------------------------- 1460 //----- (004A8C27) --------------------------------------------------------
1492 HRESULT stru6::RenderSpecialEffects() 1461 void stru6::RenderSpecialEffects()
1493 { 1462 {
1494 stru6 *v1; // ebx@1
1495 int *v2; // edi@1
1496 HRESULT result; // eax@3
1497 double v4; // st7@4 1463 double v4; // st7@4
1498 double v5; // st6@4 1464 double v5; // st6@4
1499 double v6; // st7@4 1465 double v6; // st7@4
1500 float v7; // ST14_4@6 1466 float v7; // ST14_4@6
1501 unsigned int v8; // ST14_4@8 1467 unsigned int v8; // ST14_4@8
1516 RenderVertexD3D3 vd3d[4]; // [sp+60h] [bp-8Ch]@9 1482 RenderVertexD3D3 vd3d[4]; // [sp+60h] [bp-8Ch]@9
1517 int v24; // [sp+E0h] [bp-Ch]@10 1483 int v24; // [sp+E0h] [bp-Ch]@10
1518 SpriteFrame *v70; // [sp+E4h] [bp-8h]@8 1484 SpriteFrame *v70; // [sp+E4h] [bp-8h]@8
1519 unsigned int v26; // [sp+E8h] [bp-4h]@3 1485 unsigned int v26; // [sp+E8h] [bp-4h]@3
1520 1486
1521 //by the time we first get in this function, dword_0005D4 is still not initialized in the original exe 1487 if (uNumProjectiles)
1522 //maybe the following code in never executed at all
1523
1524 v1 = this;
1525 v2 = &this->uNumProjectiles;
1526 if ( this->uNumProjectiles )
1527 { 1488 {
1528 DrawProjectiles(); 1489 DrawProjectiles();
1529 *v2 = 0; 1490 uNumProjectiles = 0;
1530 } 1491 }
1531 result = v1->uFadeTime; 1492
1532 v1->field_204 = 0; 1493 field_204 = 0;
1533 v26 = result; 1494 v26 = uFadeTime;
1534 if ( result > 0 ) 1495 if ( v26 > 0 )
1535 { 1496 {
1536 v4 = (double)(signed int)v26 / (double)v1->uFadeTime2; 1497 v4 = (double)(signed int)v26 / (double)uFadeTime2;
1537 v5 = 1.0 - v4 * v4; 1498 v5 = 1.0 - v4 * v4;
1538 v6 = v5; 1499 v6 = v5;
1539 if ( v5 > 0.9 ) 1500 if ( v5 > 0.9 )
1540 v6 = 1.0 - (v5 - 0.9) * 10.0; 1501 v6 = 1.0 - (v5 - 0.9) * 10.0;
1541 v7 = v6; 1502 v7 = v6;
1542 pRenderer->_4A52F1(v1->uFadeColor, v7); 1503 pRenderer->_4A52F1(uFadeColor, v7);
1543 result = pEventTimer->uTimeElapsed; 1504 uFadeTime -= pEventTimer->uTimeElapsed;
1544 v1->uFadeTime -= pEventTimer->uTimeElapsed; 1505 }
1545 } 1506
1546 if ( v1->uAnimLength > 0 ) 1507 if (uAnimLength > 0)
1547 { 1508 {
1548 v8 = 8 1509 v8 = 8
1549 * pSpriteFrameTable->pSpriteSFrames[pSpriteFrameTable->FastFindSprite("spell84")].uAnimLength 1510 * pSpriteFrameTable->pSpriteSFrames[pSpriteFrameTable->FastFindSprite("spell84")].uAnimLength
1550 - v1->uAnimLength; 1511 - uAnimLength;
1551 v9 = pSpriteFrameTable->FastFindSprite("spell84"); 1512 v9 = pSpriteFrameTable->FastFindSprite("spell84");
1552 v10 = pSpriteFrameTable->GetFrame(v9, v8); 1513 v10 = pSpriteFrameTable->GetFrame(v9, v8);
1553 v11 = v10->pHwSpriteIDs[0]; 1514 v11 = v10->pHwSpriteIDs[0];
1554 v70 = v10; 1515 v70 = v10;
1555 v1->uAnimLength -= pEventTimer->uTimeElapsed; 1516 uAnimLength -= pEventTimer->uTimeElapsed;
1556 if ( pRenderer->pRenderD3D ) 1517 if ( pRenderer->pRenderD3D )
1557 { 1518 {
1558 v12 = (double)(signed int)pViewport->uViewportX; 1519 v12 = (double)(signed int)pViewport->uViewportX;
1559 vd3d[0].pos.x = v12; 1520 vd3d[0].pos.x = v12;
1560 vd3d[1].pos.x = v12; 1521 vd3d[1].pos.x = v12;
1613 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, 1), 1574 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, 1),
1614 "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\seffects.cpp:1349"); 1575 "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\seffects.cpp:1349");
1615 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, 0); 1576 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, 0);
1616 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, true); 1577 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, true);
1617 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, true); 1578 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, true);
1618 result = pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZFUNC, 2); 1579 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZFUNC, 2);
1619 } 1580 }
1620 else 1581 else
1621 { 1582 {
1622 vsr.pTarget = pRenderer->pTargetSurface; 1583 vsr.pTarget = pRenderer->pTargetSurface;
1623 vsr.uParentBillboardID = -1; 1584 vsr.uParentBillboardID = -1;
1624 vsr.pTargetZ = pRenderer->pActiveZBuffer; 1585 vsr.pTargetZ = pRenderer->pActiveZBuffer;
1625 vsr.field_8 = (signed int)(pViewport->uViewportZ - pViewport->uViewportX) / 2; 1586 vsr.uScreenSpaceX = (signed int)(pViewport->uViewportZ - pViewport->uViewportX) / 2;
1626 vsr.field_C = pViewport->uViewportW; 1587 vsr.uScreenSpaceY = pViewport->uViewportW;
1627 v24 = 16777216; 1588 v24 = 16777216;
1628 LODWORD(v18) = 0; 1589 LODWORD(v18) = 0;
1629 HIDWORD(v18) = (signed __int16)(LOWORD(pViewport->uViewportZ) - LOWORD(pViewport->uViewportX)); 1590 HIDWORD(v18) = (signed __int16)(LOWORD(pViewport->uViewportZ) - LOWORD(pViewport->uViewportX));
1630 vsr.field_10 = v18 / 16777216; 1591 vsr.field_10 = v18 / 16777216;
1631 LODWORD(v18) = 0; 1592 LODWORD(v18) = 0;
1636 vsr.uTargetPitch = pRenderer->uTargetSurfacePitch; 1597 vsr.uTargetPitch = pRenderer->uTargetSurfacePitch;
1637 vsr.uParentBillboardID = -1; 1598 vsr.uParentBillboardID = -1;
1638 vsr.uViewportX = pViewport->uViewportX; 1599 vsr.uViewportX = pViewport->uViewportX;
1639 vsr.uViewportZ = pViewport->uViewportZ; 1600 vsr.uViewportZ = pViewport->uViewportZ;
1640 vsr.uViewportY = pViewport->uViewportY; 1601 vsr.uViewportY = pViewport->uViewportY;
1641 result = pViewport->uViewportW; 1602 vsr.sZValue = 0;
1642 vsr.field_28 = 0;
1643 vsr.uViewportW = pViewport->uViewportW; 1603 vsr.uViewportW = pViewport->uViewportW;
1644 vsr.uFlags = 0; 1604 vsr.uFlags = 0;
1645 if ( v11 >= 0 ) 1605 if ( v11 >= 0 )
1646 result = pSprites_LOD->pSpriteHeaders[v11]._4ACC38(&vsr, 1); 1606 pSprites_LOD->pSpriteHeaders[v11]._4ACC38(&vsr, 1);
1647 } 1607 }
1648 } 1608 }
1649 return result;
1650 } 1609 }
1651 1610
1652 //----- (004A902A) -------------------------------------------------------- 1611 //----- (004A902A) --------------------------------------------------------
1653 void stru6::DrawPlayerBuffAnims() 1612 void stru6::DrawPlayerBuffAnims()
1654 { 1613 {