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