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