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