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