Mercurial > mm7
annotate stru6.cpp @ 2535:3a36de426f5f
For draw uPlayerCreationUI_ArrowAnim
author | Ritor1 |
---|---|
date | Sun, 15 Feb 2015 23:39:07 +0600 |
parents | c7264ab7132f |
children | a902abdfc7f2 |
rev | line source |
---|---|
2415 | 1 #define _CRTDBG_MAP_ALLOC |
2 #include <stdlib.h> | |
3 #include <crtdbg.h> | |
4 | |
2253
aff7a7b072b7
adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents:
2207
diff
changeset
|
5 #define _CRT_SECURE_NO_WARNINGS |
0 | 6 #include "stru6.h" |
1016 | 7 |
2496 | 8 #include "Engine/Graphics/LightmapBuilder.h" |
2499 | 9 #include "Engine/Objects/SpriteObject.h" |
2496 | 10 #include "Engine/Graphics/ParticleEngine.h" |
2499 | 11 #include "Engine/Game.h" |
12 #include "Engine/LOD.h" | |
2496 | 13 #include "Engine/Graphics/Sprites.h" |
2499 | 14 #include "Engine/Objects/ObjectList.h" |
15 #include "Engine/Objects/Actor.h" | |
16 #include "Engine/Random.h" | |
17 #include "Engine/Tables/IconFrameTable.h" | |
18 #include "Engine/Timer.h" | |
2496 | 19 #include "Engine/Graphics/Viewport.h" |
20 #include "Engine/Graphics/Overlays.h" | |
2499 | 21 #include "Engine/stru160.h" |
22 #include "Engine/OurMath.h" | |
2496 | 23 #include "Engine/Graphics/Lights.h" |
0 | 24 |
2499 | 25 #include "Engine/MM7.h" |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
26 |
2496 | 27 #include "Engine/Graphics/Indoor.h" |
0 | 28 |
29 | |
30 | |
31 | |
2152 | 32 //----- (004A7063) -------------------------------------------------------- |
33 unsigned int ModulateColor(unsigned int diffuse, float multiplier) | |
34 { | |
35 float alpha = multiplier * ((diffuse >> 24) & 0xFF); | |
36 int a = (int)floorf(alpha + 0.5f); | |
37 a = max(0, min(255, a)); | |
38 | |
39 float red = multiplier * ((diffuse >> 16) & 0xFF); | |
40 int r = (int)floorf(red + 0.5f); | |
41 r = max(0, min(255, r)); | |
42 | |
43 float green = multiplier * ((diffuse >> 8) & 0xFF); | |
44 int g = (int)floorf(green + 0.5f); | |
45 g = max(0, min(255, g)); | |
46 | |
47 float blue = multiplier * ((diffuse >> 0) & 0xFF); | |
48 int b = (int)floorf(blue + 0.5f); | |
49 b = max(0, min(255, b)); | |
50 | |
51 return (a << 24) | (r << 16) | (g << 8) | b; | |
52 } | |
53 | |
54 | |
1459 | 55 //----- (0042620A) -------------------------------------------------------- |
56 bool sr_42620A(RenderVertexSoft *p) | |
57 { | |
2334 | 58 // __int16 v1; // fps@1 |
1459 | 59 unsigned __int8 v2; // c0@2 |
60 char v3; // c2@2 | |
61 unsigned __int8 v4; // c3@2 | |
2334 | 62 // bool result; // eax@2 |
1459 | 63 unsigned __int8 v6; // c0@4 |
64 char v7; // c2@4 | |
65 unsigned __int8 v8; // c3@4 | |
66 unsigned __int8 v9; // c0@6 | |
67 char v10; // c2@6 | |
68 unsigned __int8 v11; // c3@6 | |
69 double v12; // st6@7 | |
70 float v13; // ST04_4@7 | |
71 float v14; // ST00_4@7 | |
72 double v15; // st7@7 | |
73 double v16; // st6@8 | |
74 float v17; // ST04_4@8 | |
75 float v18; // ST00_4@8 | |
76 double v19; // st7@8 | |
77 | |
78 //UNDEF(v1); | |
79 if ( p->vWorldViewPosition.x < 300.0 | |
80 || (v2 = 300.0 < p[1].vWorldViewPosition.x, | |
81 v3 = 0, | |
82 v4 = 300.0 == p[1].vWorldViewPosition.x, | |
83 //BYTE1(result) = HIBYTE(v1), | |
84 !(v2 | v4)) ) | |
85 { | |
86 if ( p->vWorldViewPosition.x < 300.0 ) | |
87 { | |
88 v6 = 300.0 < p[1].vWorldViewPosition.x; | |
89 v7 = 0; | |
90 v8 = 300.0 == p[1].vWorldViewPosition.x; | |
91 //BYTE1(result) = HIBYTE(v1); | |
92 if ( !(v6 | v8) ) | |
93 { | |
94 //LOBYTE(result) = 0; | |
95 return false; | |
96 } | |
97 } | |
98 v9 = 300.0 < p->vWorldViewPosition.x; | |
99 v10 = 0; | |
100 v11 = 300.0 == p->vWorldViewPosition.x; | |
101 //BYTE1(result) = HIBYTE(v1); | |
102 if ( v9 | v11 ) | |
103 { | |
104 v16 = 1.0 / (p->vWorldViewPosition.x - p[1].vWorldViewPosition.x); | |
105 v17 = (p->vWorldViewPosition.y - p[1].vWorldViewPosition.y) * v16; | |
106 v18 = (p->vWorldViewPosition.z - p[1].vWorldViewPosition.z) * v16; | |
107 v19 = 300.0 - p[1].vWorldViewPosition.x; | |
108 p[1].vWorldViewPosition.x = v19 + p[1].vWorldViewPosition.x; | |
109 p[1].vWorldViewPosition.y = v17 * v19 + p[1].vWorldViewPosition.y; | |
110 p[1].vWorldViewPosition.z = v19 * v18 + p[1].vWorldViewPosition.z; | |
111 } | |
112 else | |
113 { | |
114 v12 = 1.0 / (p[1].vWorldViewPosition.x - p->vWorldViewPosition.x); | |
115 v13 = (p[1].vWorldViewPosition.y - p->vWorldViewPosition.y) * v12; | |
116 v14 = (p[1].vWorldViewPosition.z - p->vWorldViewPosition.z) * v12; | |
117 v15 = 300.0 - p->vWorldViewPosition.x; | |
118 p->vWorldViewPosition.x = v15 + p->vWorldViewPosition.x; | |
119 p->vWorldViewPosition.y = v13 * v15 + p->vWorldViewPosition.y; | |
120 p->vWorldViewPosition.z = v15 * v14 + p->vWorldViewPosition.z; | |
121 } | |
122 } | |
123 //LOBYTE(result) = 1; | |
124 return true; | |
125 } | |
126 | |
127 | |
128 | |
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
|
129 //----- (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
|
130 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
|
131 { |
2370 | 132 delete [] pArray1; |
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
|
133 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
|
134 |
2370 | 135 delete [] pArray2; |
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
|
136 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
|
137 } |
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
|
138 |
0 | 139 |
140 //----- (00478211) -------------------------------------------------------- | |
141 void stru6_stru1_indoor_sw_billboard::Initialize(int a2) | |
142 { | |
143 uNumVec4sInArray1 = 66; | |
144 pArray1 = new stru16x[66]; | |
145 | |
146 uNumVec3sInArray2 = 128; | |
147 pArray2 = new stru160[128]; | |
148 | |
149 for (uint i = 0; i < uNumVec4sInArray1; ++i) | |
150 { | |
151 pArray1[i].field_0 = array_4EB8B8[i].field_0; | |
152 pArray1[i].field_4 = array_4EB8B8[i].field_4; | |
153 pArray1[i].field_8 = array_4EB8B8[i].field_8; | |
154 pArray1[i].field_C = a2; | |
155 } | |
1207
96a81634669e
arrays to std::arrays phase 3 - finishing global arrays
Grumpy7
parents:
1106
diff
changeset
|
156 memcpy(pArray2, array_4EBBD0_x.data()/*array_4EBBD0*/, uNumVec3sInArray2 * sizeof(stru160)); |
0 | 157 } |
158 | |
159 //----- (0047829F) -------------------------------------------------------- | |
1390 | 160 void stru6_stru1_indoor_sw_billboard::_47829F_sphere_particle(float x_offset, float y_offset, float z_offset, float scale, int diffuse) |
0 | 161 { |
1390 | 162 int v7 = 0; |
0 | 163 |
1390 | 164 for (unsigned int i = 0; i < uNumVec3sInArray2; ++i) |
0 | 165 { |
1390 | 166 for (unsigned int j = 0; j < 3; ++j) |
0 | 167 { |
1390 | 168 field_14[j].x = x_offset + scale * *(&pArray1->field_0 + 4 * *(int *)((char *)&pArray2->field_0 + v7)); |
169 field_14[j].y = y_offset + scale * *(&pArray1->field_4 + 4 * *(int *)((char *)&pArray2->field_0 + v7)); | |
170 field_14[j].z = z_offset + scale * *(&pArray1->field_8 + 4 * *(int *)((char *)&pArray2->field_0 + v7)); | |
2198 | 171 //int v10 = *(int *)((char *)&pArray2->field_0 + v7); |
1390 | 172 |
2198 | 173 field_14[j].diffuse = *((int *)&pArray1[1].field_0 + 4 * (*(int *)((char *)&pArray2->field_0 + v7))); |
0 | 174 v7 += 4; |
175 } | |
1390 | 176 |
177 uNumVertices = 3; | |
178 if ( sub_477C61() && sub_477F63() ) | |
0 | 179 { |
1390 | 180 if ( sub_47802A() ) |
181 pRenderer->_4A4CC9_AddSomeBillboard(this, diffuse); | |
0 | 182 } |
183 } | |
184 } | |
185 | |
186 | |
187 | |
188 | |
189 //----- (004A71FE) -------------------------------------------------------- | |
190 void stru6::DoAddProjectile(float srcX, float srcY, float srcZ, float dstX, float dstY, float dstZ, unsigned int uTextureID) | |
191 { | |
486 | 192 //int v8; // eax@1 |
0 | 193 |
486 | 194 //v8 = uNumProjectiles; |
195 if (uNumProjectiles < 32) | |
0 | 196 { |
486 | 197 pProjectiles[uNumProjectiles].srcX = srcX; |
198 pProjectiles[uNumProjectiles].srcY = srcY; | |
0 | 199 pProjectiles[uNumProjectiles].srcZ = srcZ; |
200 pProjectiles[uNumProjectiles].dstX = dstX; | |
201 pProjectiles[uNumProjectiles].dstY = dstY; | |
202 pProjectiles[uNumProjectiles].dstZ = dstZ; | |
203 pProjectiles[uNumProjectiles++].uTextureID = uTextureID; | |
204 } | |
205 } | |
206 | |
207 //----- (004A7298) -------------------------------------------------------- | |
208 void stru6::DrawProjectiles() | |
209 { | |
210 float v10; // ST1C_4@8 | |
211 float v11; // ST0C_4@8 | |
212 IDirect3DTexture2 *v12; // [sp+20h] [bp-78h]@6 | |
213 RenderVertexSoft v[2]; // [sp+30h] [bp-68h]@1 | |
214 | |
215 for (uint i = 0; i < uNumProjectiles; ++i) | |
216 { | |
1980 | 217 ProjectileAnim* p = &pProjectiles[i]; |
0 | 218 |
219 v[0].vWorldPosition.x = p->srcX; | |
220 v[0].vWorldPosition.y = p->srcY; | |
221 v[0].vWorldPosition.z = p->srcZ; | |
222 v[1].vWorldPosition.x = p->dstX; | |
223 v[1].vWorldPosition.y = p->dstY; | |
224 v[1].vWorldPosition.z = p->dstZ; | |
225 pGame->pIndoorCameraD3D->ViewTransform(v, 2); | |
226 | |
227 sr_42620A(v); | |
228 | |
229 pGame->pIndoorCameraD3D->Project(v, 2, 0); | |
230 | |
231 if (p->uTextureID != -1) | |
232 v12 = pBitmaps_LOD->pHardwareTextures[p->uTextureID]; | |
233 else | |
234 v12 = 0; | |
235 | |
236 v10 = pGame->pIndoorCameraD3D->fov_x / v[1].vWorldViewPosition.x * 20.0; | |
237 v11 = pGame->pIndoorCameraD3D->fov_x / v[0].vWorldViewPosition.x * 20.0; | |
238 pRenderer->DrawProjectile( | |
239 v[0].vWorldViewProjX, | |
240 v[0].vWorldViewProjY, | |
241 v[0].vWorldViewPosition.x, | |
242 v11, | |
243 v[1].vWorldViewProjX, | |
244 v[1].vWorldViewProjY, | |
245 v[1].vWorldViewPosition.x, | |
246 v10, | |
247 v12); | |
248 } | |
249 } | |
250 | |
251 //----- (004A73AA) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
252 void stru6::_4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(SpriteObject *a2, unsigned int uDiffuse, unsigned int uTextureID) |
0 | 253 { |
254 stru6 *v4; // edi@1 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
255 SpriteObject *v5; // esi@1 |
0 | 256 int v6; // eax@1 |
257 stru6_stru2 *v7; // eax@2 | |
258 double v8; // st7@2 | |
259 double v9; // st6@2 | |
260 double v10; // st7@3 | |
619 | 261 Particle_sw local_0; // [sp+8h] [bp-68h]@1 |
0 | 262 float x; // [sp+78h] [bp+8h]@2 |
263 | |
264 v4 = this; | |
265 memset(&local_0, 0, 0x68u); | |
266 v5 = a2; | |
267 v6 = a2->field_54; | |
268 if ( v6 ) | |
269 { | |
486 | 270 v7 = &v4->array_4[v6 & 0x1F]; |
271 x = ((double)a2->vPosition.x - v7->flt_0_x) * 0.5 + v7->flt_0_x; | |
272 v8 = ((double)v5->vPosition.y - v7->flt_4_y) * 0.5 + v7->flt_4_y; | |
273 v9 = ((double)v5->vPosition.z - v7->flt_8_z) * 0.5 + v7->flt_8_z; | |
619 | 274 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; |
0 | 275 local_0.uDiffuse = uDiffuse; |
276 local_0.x = x + 4.0; | |
277 local_0.y = v8; | |
278 local_0.z = v9; | |
1390 | 279 local_0.r = 0.0; |
280 local_0.g = 0.0; | |
281 local_0.b = 0.0; | |
0 | 282 local_0.timeToLive = (rand() & 0x40) + 96; |
283 local_0.uTextureID = uTextureID; | |
284 local_0.flt_28 = 1.0; | |
285 pGame->pParticleEngine->AddParticle(&local_0); | |
286 local_0.x = x - 4.0; | |
287 pGame->pParticleEngine->AddParticle(&local_0); | |
288 local_0.x = (double)v5->vPosition.x + 4.0; | |
289 local_0.y = (double)v5->vPosition.y; | |
290 local_0.z = (double)v5->vPosition.z; | |
291 pGame->pParticleEngine->AddParticle(&local_0); | |
292 local_0.x = (double)v5->vPosition.x - 4.0; | |
293 pGame->pParticleEngine->AddParticle(&local_0); | |
486 | 294 v4->array_4[v5->field_54 & 0x1F].flt_0_x = (double)v5->vPosition.x; |
295 v4->array_4[v5->field_54 & 0x1F].flt_4_y = (double)v5->vPosition.y; | |
296 v4->array_4[v5->field_54 & 0x1F].flt_8_z = (double)v5->vPosition.z; | |
0 | 297 } |
298 else | |
299 { | |
486 | 300 a2->field_54 = v4->field_0++; |
301 v4->array_4[a2->field_54 & 0x1F].flt_0_x = (double)a2->vPosition.x; | |
302 v4->array_4[a2->field_54 & 0x1F].flt_4_y = (double)a2->vPosition.y; | |
303 v4->array_4[a2->field_54 & 0x1F].flt_8_z = (double)a2->vPosition.z; | |
0 | 304 v10 = (double)a2->vPosition.x; |
619 | 305 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; |
0 | 306 local_0.uDiffuse = uDiffuse; |
307 local_0.x = v10 + 4.0; | |
308 local_0.y = (double)a2->vPosition.y; | |
309 local_0.z = (double)a2->vPosition.z; | |
1390 | 310 local_0.r = 0.0; |
311 local_0.g = 0.0; | |
312 local_0.b = 0.0; | |
0 | 313 local_0.flt_28 = 1.0; |
314 local_0.timeToLive = (rand() & 0x7F) + 128; | |
315 local_0.uTextureID = uTextureID; | |
316 pGame->pParticleEngine->AddParticle(&local_0); | |
317 local_0.x = (double)a2->vPosition.x - 4.0; | |
318 pGame->pParticleEngine->AddParticle(&local_0); | |
319 } | |
320 } | |
321 | |
322 //----- (004A75CC) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
323 void stru6::_4A75CC_single_spell_collision_particle(SpriteObject *a1, unsigned int uDiffuse, unsigned int uTextureID) |
0 | 324 { |
325 double v4; // st7@1 | |
326 signed int v5; // edi@1 | |
619 | 327 Particle_sw local_0; // [sp+8h] [bp-68h]@1 |
0 | 328 |
329 memset(&local_0, 0, 0x68u); | |
619 | 330 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_1; |
0 | 331 local_0.x = (double)a1->vPosition.x; |
332 local_0.y = (double)a1->vPosition.y; | |
333 v4 = (double)a1->vPosition.z; | |
334 local_0.uDiffuse = uDiffuse; | |
335 local_0.z = v4; | |
336 v5 = 10; | |
337 local_0.timeToLive = (rand() & 0x7F) + 128; | |
338 local_0.uTextureID = uTextureID; | |
339 local_0.flt_28 = 1.0; | |
340 do | |
341 { | |
1390 | 342 local_0.r = (double)(rand() & 0x1FF) - 255.0; |
343 local_0.g = (double)(rand() & 0x1FF) - 255.0; | |
344 local_0.b = (double)(rand() & 0x1FF) - 255.0; | |
0 | 345 pGame->pParticleEngine->AddParticle(&local_0); |
346 --v5; | |
347 } | |
348 while ( v5 ); | |
349 } | |
350 | |
351 //----- (004A7688) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
352 void stru6::_4A7688_fireball_collision_particle(SpriteObject *a2) |
0 | 353 { |
354 double v3; // st7@1 | |
355 double v4; // st7@2 | |
619 | 356 Particle_sw local_0; // [sp+1Ch] [bp-7Ch]@1 |
0 | 357 |
358 memset(&local_0, 0, 0x68u); | |
1390 | 359 |
0 | 360 v3 = (double)a2->uSpriteFrameID / (double)pObjectList->pObjects[a2->uObjectDescID].uLifetime; |
361 if ( v3 >= 0.75 ) | |
362 v4 = (1.0 - v3) * 4.0; | |
363 else | |
364 v4 = v3 * 1.333333333333333; | |
1390 | 365 |
619 | 366 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_1; |
367 local_0.uDiffuse = 0xFF3C1E; | |
1390 | 368 local_0.x = (double)a2->vPosition.x; |
0 | 369 local_0.y = (double)a2->vPosition.y; |
370 local_0.z = (double)a2->vPosition.z; | |
371 local_0.timeToLive = (rand() & 0x7F) + 128; | |
372 local_0.uTextureID = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT); | |
373 local_0.flt_28 = 1.0; | |
1390 | 374 |
375 // 10 fireball sparks | |
376 for (unsigned int i = 0; i < 10; ++i) | |
0 | 377 { |
1390 | 378 local_0.r = (rand() & 0x1FF) - 255; |
379 local_0.g = (rand() & 0x1FF) - 255; | |
380 local_0.b = (rand() & 0x1FF) - 255; | |
0 | 381 pGame->pParticleEngine->AddParticle(&local_0); |
382 } | |
1390 | 383 |
2198 | 384 pStru1->_47829F_sphere_particle((double)a2->vPosition.x, (double)a2->vPosition.y, (double)a2->vPosition.z, |
385 (double)floorf(0.5f + (512.0 * v3)), ModulateColor(0xFF3C1E, v4)); | |
0 | 386 } |
387 | |
388 //----- (004A77FD) -------------------------------------------------------- | |
2154 | 389 void stru6::_4A77FD_implosion_particle_d3d(SpriteObject *a1) |
0 | 390 { |
391 double v4; // st7@1 | |
392 double v5; // st7@2 | |
393 int v7; // eax@4 | |
394 float v8; // ST0C_4@4 | |
395 float v9; // ST08_4@4 | |
396 float v10; // ST04_4@4 | |
397 float v11; // ST00_4@4 | |
398 float v12; // [sp+28h] [bp-4h]@1 | |
399 | |
400 v4 = (double)a1->uSpriteFrameID / (double)pObjectList->pObjects[a1->uObjectDescID].uLifetime; | |
401 v12 = 512.0 - v4 * 512.0; | |
402 if ( v4 >= 0.75 ) | |
403 v5 = v4 * 4.0; | |
404 else | |
405 v5 = v4 * 1.333333333333333; | |
1390 | 406 |
407 v7 = ModulateColor(0x7E7E7E, v5); | |
408 v8 = (double)floorf(0.5f + v12); | |
409 v9 = (double)a1->vPosition.z; | |
410 v10 = (double)a1->vPosition.y; | |
411 v11 = (double)a1->vPosition.x; | |
412 pStru1->_47829F_sphere_particle(v11, v10, v9, v8, v7); | |
0 | 413 } |
414 | |
415 //----- (004A78AE) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
416 void stru6::_4A78AE_sparks_spell(SpriteObject *a1) |
0 | 417 { |
418 ObjectDesc *v2; // esi@1 | |
419 unsigned int v3; // eax@1 | |
420 double v4; // st7@1 | |
619 | 421 Particle_sw local_0; // [sp+8h] [bp-68h]@1 |
0 | 422 |
423 v2 = &pObjectList->pObjects[a1->uObjectDescID]; | |
424 memset(&local_0, 0, 0x68u); | |
425 v3 = a1->uSpriteFrameID; | |
426 local_0.x = (double)a1->vPosition.x; | |
427 v4 = (double)a1->vPosition.y; | |
619 | 428 local_0.type = ParticleType_Sprite; |
429 local_0.uDiffuse = 0x7F7F7F; | |
0 | 430 local_0.timeToLive = 1; |
431 local_0.y = v4; | |
432 local_0.z = (double)a1->vPosition.z; | |
1390 | 433 local_0.r = 0.0; |
434 local_0.g = 0.0; | |
435 local_0.b = 0.0; | |
0 | 436 local_0.uTextureID = pSpriteFrameTable->GetFrame(v2->uSpriteID, v3)->pHwSpriteIDs[0]; |
437 LODWORD(local_0.flt_28) = 0x40000000u; | |
438 pGame->pParticleEngine->AddParticle(&local_0); | |
439 } | |
440 | |
441 //----- (004A7948) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
442 void stru6::_4A7948_mind_blast_after_effect(SpriteObject *a1) |
0 | 443 { |
444 ObjectDesc *v2; // esi@1 | |
445 unsigned int v3; // eax@1 | |
446 double v4; // st7@1 | |
447 char v5; // al@1 | |
448 signed int v6; // edi@1 | |
619 | 449 Particle_sw Dst; // [sp+8h] [bp-68h]@1 |
0 | 450 |
451 v2 = &pObjectList->pObjects[a1->uObjectDescID]; | |
452 memset(&Dst, 0, 0x68u); | |
453 v3 = a1->uSpriteFrameID; | |
454 Dst.x = (double)a1->vPosition.x; | |
455 v4 = (double)a1->vPosition.y; | |
619 | 456 Dst.type = ParticleType_Sprite | ParticleType_Rotating | ParticleType_1; |
457 Dst.uDiffuse = 0x7F7F7F; | |
0 | 458 Dst.y = v4; |
459 Dst.z = (double)a1->vPosition.z; | |
460 Dst.uTextureID = pSpriteFrameTable->GetFrame(v2->uSpriteID, v3)->pHwSpriteIDs[0]; | |
461 v5 = rand(); | |
462 v6 = 10; | |
463 Dst.flt_28 = 1.0; | |
464 Dst.timeToLive = (v5 & 0x7F) + 128; | |
465 do | |
466 { | |
1390 | 467 Dst.r = (double)(rand() & 0x1FF) - 255.0; |
468 Dst.g = (double)(rand() & 0x1FF) - 255.0; | |
469 Dst.b = (double)(rand() & 0x1FF) - 255.0; | |
0 | 470 pGame->pParticleEngine->AddParticle(&Dst); |
471 --v6; | |
472 } | |
473 while ( v6 ); | |
474 } | |
475 | |
476 //----- (004A7A27) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
477 bool stru6::AddMobileLight(SpriteObject *a1, unsigned int uDiffuse, int uRadius) |
0 | 478 { |
2207 | 479 return pMobileLightsStack->AddLight(a1->vPosition.x, a1->vPosition.y, a1->vPosition.z, a1->uSectorID, uRadius, |
0 | 480 (uDiffuse & 0x00FF0000) >> 16, |
481 (uDiffuse & 0x0000FF00) >> 8, | |
482 uDiffuse & 0x000000FF, | |
2154 | 483 _4E94D3_light_type); |
0 | 484 } |
2154 | 485 // 4E94D3: using guessed type char _4E94D3_light_type; |
0 | 486 |
487 //----- (004A7A66) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
488 void stru6::_4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(SpriteObject *a1, unsigned int uDiffuse, unsigned int uTextureID, float a4) |
0 | 489 { |
490 int v5; // eax@1 | |
491 char v6; // al@1 | |
492 double v7; // st6@1 | |
493 double v8; // st6@1 | |
494 double v9; // st7@1 | |
495 double v10; // st6@1 | |
619 | 496 Particle_sw local_0; // [sp+0h] [bp-6Ch]@1 |
0 | 497 float v12; // [sp+68h] [bp-4h]@1 |
498 float a1a; // [sp+74h] [bp+8h]@1 | |
499 float uDiffusea; // [sp+78h] [bp+Ch]@1 | |
500 float uTextureIDa; // [sp+7Ch] [bp+10h]@1 | |
501 | |
502 memset(&local_0, 0, 0x68u); | |
619 | 503 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_1; |
0 | 504 local_0.x = (double)a1->vPosition.x; |
505 v5 = a1->vPosition.z; | |
506 local_0.y = (double)a1->vPosition.y; | |
507 local_0.uDiffuse = uDiffuse; | |
508 local_0.z = (double)(v5 + 32); | |
509 v6 = rand(); | |
510 local_0.flt_28 = 1.0; | |
511 v7 = 0.0 * a4; | |
512 local_0.timeToLive = (v6 & 0x7F) + 128; | |
513 local_0.uTextureID = uTextureID; | |
514 a1a = v7; | |
1390 | 515 local_0.r = v7; |
516 local_0.g = a4; | |
517 local_0.b = a4; | |
0 | 518 pGame->pParticleEngine->AddParticle(&local_0); |
519 v8 = 0.70710677 * a4; | |
520 uDiffusea = v8; | |
1390 | 521 local_0.r = v8; |
522 local_0.g = v8; | |
523 local_0.b = a4; | |
0 | 524 pGame->pParticleEngine->AddParticle(&local_0); |
1390 | 525 local_0.g = a1a; |
526 local_0.r = a4; | |
527 local_0.b = a4; | |
0 | 528 pGame->pParticleEngine->AddParticle(&local_0); |
1390 | 529 local_0.r = uDiffusea; |
530 local_0.b = a4; | |
0 | 531 v9 = -uDiffusea; |
532 uTextureIDa = v9; | |
1390 | 533 local_0.g = v9; |
0 | 534 pGame->pParticleEngine->AddParticle(&local_0); |
535 v10 = -1.0 * a4; | |
1390 | 536 local_0.r = a1a; |
0 | 537 v12 = v10; |
1390 | 538 local_0.g = v10; |
539 local_0.b = a4; | |
0 | 540 pGame->pParticleEngine->AddParticle(&local_0); |
1390 | 541 local_0.b = a4; |
542 local_0.r = uTextureIDa; | |
543 local_0.g = uTextureIDa; | |
0 | 544 pGame->pParticleEngine->AddParticle(&local_0); |
1390 | 545 local_0.r = v12; |
546 local_0.g = a1a; | |
547 local_0.b = a4; | |
0 | 548 pGame->pParticleEngine->AddParticle(&local_0); |
1390 | 549 local_0.r = uTextureIDa; |
550 local_0.g = uDiffusea; | |
551 local_0.b = a4; | |
0 | 552 pGame->pParticleEngine->AddParticle(&local_0); |
553 } | |
554 | |
555 //----- (004A7C07) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
556 void stru6::_4A7C07(SpriteObject *a2) |
0 | 557 { |
558 stru6 *v2; // edi@1 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
559 SpriteObject *v3; // esi@1 |
0 | 560 int v4; // eax@1 |
561 ObjectDesc *v5; // ebx@1 | |
562 stru6_stru2 *v6; // eax@2 | |
563 double v7; // st6@2 | |
564 double v8; // st5@2 | |
565 double v9; // st4@2 | |
566 char v10; // al@2 | |
567 double v11; // st7@2 | |
568 double v12; // st7@3 | |
619 | 569 Particle_sw local_0; // [sp+Ch] [bp-68h]@1 |
0 | 570 float a2a; // [sp+7Ch] [bp+8h]@2 |
571 | |
572 v2 = this; | |
573 memset(&local_0, 0, 0x68u); | |
574 v3 = a2; | |
575 v4 = a2->field_54; | |
576 v5 = &pObjectList->pObjects[a2->uObjectDescID]; | |
577 if ( v4 ) | |
578 { | |
486 | 579 v6 = &v2->array_4[v4 & 0x1F]; |
580 v7 = ((double)a2->vPosition.x - v6->flt_0_x) * 0.5 + v6->flt_0_x; | |
581 v8 = ((double)a2->vPosition.y - v6->flt_4_y) * 0.5 + v6->flt_4_y; | |
582 v9 = ((double)a2->vPosition.z - v6->flt_8_z) * 0.5 + v6->flt_8_z; | |
619 | 583 local_0.type = ParticleType_Sprite; |
584 local_0.uDiffuse = 0xFFFFFF; | |
0 | 585 a2a = v9; |
586 local_0.x = v7; | |
587 local_0.z = a2a; | |
588 local_0.y = v8; | |
1390 | 589 local_0.r = 0.0; |
590 local_0.g = 0.0; | |
591 local_0.b = 0.0; | |
0 | 592 v10 = rand(); |
593 LODWORD(local_0.flt_28) = 0x40400000u; | |
594 local_0.timeToLive = (v10 & 0x3F) + 64; | |
595 local_0.uTextureID = pSpriteFrameTable->GetFrame(v5->uSpriteID, v3->uSpriteFrameID)->pHwSpriteIDs[0]; | |
596 pGame->pParticleEngine->AddParticle(&local_0); | |
597 v11 = (double)v3->vPosition.x; | |
598 LODWORD(local_0.flt_28) = 0x40800000u; | |
599 local_0.x = v11; | |
600 local_0.y = (double)v3->vPosition.y; | |
601 local_0.z = (double)v3->vPosition.z; | |
602 local_0.timeToLive = (rand() & 0x3F) + 64; | |
603 pGame->pParticleEngine->AddParticle(&local_0); | |
486 | 604 v2->array_4[v3->field_54 & 0x1F].flt_0_x = (double)v3->vPosition.x; |
605 v2->array_4[v3->field_54 & 0x1F].flt_4_y = (double)v3->vPosition.y; | |
606 v2->array_4[v3->field_54 & 0x1F].flt_8_z = (double)v3->vPosition.z; | |
0 | 607 } |
608 else | |
609 { | |
486 | 610 a2->field_54 = v2->field_0++; |
611 v2->array_4[a2->field_54 & 0x1F].flt_0_x = (double)a2->vPosition.x; | |
612 v2->array_4[a2->field_54 & 0x1F].flt_4_y = (double)a2->vPosition.y; | |
613 v2->array_4[a2->field_54 & 0x1F].flt_8_z = (double)a2->vPosition.z; | |
0 | 614 v12 = (double)a2->vPosition.x; |
619 | 615 local_0.type = ParticleType_Sprite; |
616 local_0.uDiffuse = 0xFFFFFF; | |
0 | 617 LODWORD(local_0.flt_28) = 0x40000000u; |
618 local_0.x = v12; | |
619 local_0.y = (double)a2->vPosition.y; | |
620 local_0.z = (double)a2->vPosition.z; | |
1390 | 621 local_0.r = 0.0; |
622 local_0.g = 0.0; | |
623 local_0.b = 0.0; | |
0 | 624 local_0.timeToLive = (rand() & 0x3F) + 64; |
625 local_0.uTextureID = pSpriteFrameTable->GetFrame(v5->uSpriteID, a2->uSpriteFrameID)->pHwSpriteIDs[0]; | |
626 pGame->pParticleEngine->AddParticle(&local_0); | |
627 } | |
628 } | |
629 | |
630 //----- (004A7E05) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
631 void stru6::AddProjectile(SpriteObject *a2, int a3, unsigned int uTextureID) |
0 | 632 { |
1390 | 633 if (a2->field_54) |
0 | 634 { |
1390 | 635 DoAddProjectile(array_4[a2->field_54 & 0x1F].flt_0_x, |
636 array_4[a2->field_54 & 0x1F].flt_4_y, | |
637 array_4[a2->field_54 & 0x1F].flt_8_z, | |
638 a2->vPosition.x, | |
639 a2->vPosition.y, | |
640 a2->vPosition.z, | |
641 uTextureID); | |
0 | 642 } |
643 else | |
644 { | |
1390 | 645 a2->field_54 = field_0++; |
646 array_4[a2->field_54 & 0x1F].flt_0_x = (double)a2->vPosition.x; | |
647 array_4[a2->field_54 & 0x1F].flt_4_y = (double)a2->vPosition.y; | |
648 array_4[a2->field_54 & 0x1F].flt_8_z = (double)a2->vPosition.z; | |
0 | 649 } |
650 } | |
651 | |
652 //----- (004A7E89) -------------------------------------------------------- | |
142 | 653 void stru6::_4A7E89_sparkles_on_actor_after_it_casts_buff(Actor *pActor, unsigned int uDiffuse) |
0 | 654 { |
655 Actor *v3; // edi@1 | |
656 int v4; // ebx@3 | |
142 | 657 //int result; // eax@5 |
619 | 658 Particle_sw Dst; // [sp+Ch] [bp-6Ch]@1 |
0 | 659 int v7; // [sp+74h] [bp-4h]@2 |
660 signed int pActora; // [sp+80h] [bp+8h]@1 | |
661 | |
662 memset(&Dst, 0, 0x68u); | |
619 | 663 Dst.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; |
0 | 664 Dst.timeToLive = (rand() & 0x7F) + 128; |
665 v3 = pActor; | |
666 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar02", TEXTURE_DEFAULT); | |
667 pActora = 50; | |
668 Dst.flt_28 = 1.0; | |
669 do | |
670 { | |
671 v7 = (unsigned __int8)rand() + v3->vPosition.x - 127; | |
672 Dst.x = (double)v7; | |
673 v7 = (unsigned __int8)rand() + v3->vPosition.y - 127; | |
674 Dst.y = (double)v7; | |
675 v7 = v3->vPosition.z + (unsigned __int8)rand(); | |
676 Dst.z = (double)v7; | |
677 if ( uDiffuse ) | |
678 { | |
679 Dst.uDiffuse = uDiffuse; | |
680 } | |
681 else | |
682 { | |
683 v4 = rand() << 16; | |
684 Dst.uDiffuse = rand() | v4; | |
685 } | |
686 pGame->pParticleEngine->AddParticle(&Dst); | |
687 --pActora; | |
688 } | |
689 while ( pActora ); | |
690 } | |
691 | |
692 //----- (004A7F74) -------------------------------------------------------- | |
693 void stru6::_4A7F74(int x, int y, int z) | |
694 { | |
695 stru6 *v4; // esi@1 | |
696 char v5; // al@1 | |
697 signed int v6; // edi@1 | |
698 unsigned int v7; // eax@1 | |
699 double v8; // st7@2 | |
700 double v9; // st7@2 | |
619 | 701 Particle_sw local_0; // [sp+8h] [bp-78h]@1 |
0 | 702 double v11; // [sp+70h] [bp-10h]@1 |
703 double v12; // [sp+78h] [bp-8h]@1 | |
704 float z1; // [sp+88h] [bp+8h]@2 | |
705 | |
706 v4 = this; | |
707 memset(&local_0, 0, 0x68u); | |
619 | 708 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_1; |
709 local_0.uDiffuse = 0x7E7E7E; | |
0 | 710 v5 = rand(); |
711 local_0.flt_28 = 1.0; | |
712 v6 = 8; | |
713 local_0.timeToLive = (v5 & 0x7F) + 128; | |
714 v7 = v4->uTextureID_effpar1; | |
715 v12 = (double)x; | |
716 local_0.uTextureID = v7; | |
717 v11 = (double)y; | |
718 do | |
719 { | |
720 v8 = pRnd->GetRandom(); | |
721 local_0.x = v8 * 40.0 - 20.0 + v12; | |
722 v9 = pRnd->GetRandom(); | |
723 z1 = (double)z; | |
724 local_0.z = z1; | |
725 local_0.y = v9 * 40.0 - 20.0 + v11; | |
1390 | 726 local_0.r = pRnd->GetRandom() * 400.0 - 200.0; |
727 local_0.g = pRnd->GetRandom() * 400.0 - 200.0; | |
728 local_0.b = pRnd->GetRandom() * 150.0 + 50.0; | |
0 | 729 pGame->pParticleEngine->AddParticle(&local_0); |
730 --v6; | |
731 } | |
732 while ( v6 ); | |
733 } | |
734 | |
735 //----- (004A806F) -------------------------------------------------------- | |
736 int stru6::_4A806F(Actor *pActor) | |
737 { | |
738 int v2; // ecx@1 | |
739 unsigned int v3; // eax@1 | |
740 double v4; // st7@2 | |
741 float v5; // ST00_4@6 | |
742 | |
743 v2 = (int)pActor; | |
1954
730166317ed0
pActorBuffs[10] to pActorBuffs[ACTOR_BUFF_MASS_DISTORTION]
Grumpy7
parents:
1705
diff
changeset
|
744 v3 = LODWORD(pActor->pActorBuffs[ACTOR_BUFF_MASS_DISTORTION].uExpireTime) - pMiscTimer->uTotalGameTimeElapsed; |
0 | 745 if ( (signed int)v3 <= 64 ) |
746 { | |
747 if ( (v3 & 0x80000000u) != 0 ) | |
748 { | |
1954
730166317ed0
pActorBuffs[10] to pActorBuffs[ACTOR_BUFF_MASS_DISTORTION]
Grumpy7
parents:
1705
diff
changeset
|
749 pActor->pActorBuffs[ACTOR_BUFF_MASS_DISTORTION].uExpireTime = 0i64; |
0 | 750 v4 = 1.0; |
751 } | |
752 else | |
753 { | |
754 v2 = v3 * v3; | |
755 v4 = 1.0 - (double)(signed int)(v3 * v3) * 0.0001953125; | |
756 } | |
757 } | |
758 else | |
759 { | |
760 v2 = (v3 - 64) * (v3 - 64); | |
761 v4 = (double)v2 * 0.0001953125 + 0.2; | |
762 } | |
763 v5 = v4; | |
1029 | 764 return fixpoint_from_float(v5); |
0 | 765 } |
766 | |
767 //----- (004A81CA) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
768 bool stru6::_4A81CA(SpriteObject *a2) |
0 | 769 { |
564 | 770 //stru6 *v2; // ebx@1 |
0 | 771 int result; // eax@1 |
2334 | 772 // int v4; // eax@27 |
564 | 773 //unsigned int diffuse; // esi@41 |
774 //int v6; // ecx@49 | |
0 | 775 int v7; // eax@54 |
776 int v8; // eax@55 | |
777 char v9; // zf@56 | |
778 int v10; // eax@59 | |
779 int v11; // eax@61 | |
780 int v12; // eax@85 | |
781 int v13; // eax@86 | |
782 int v14; // eax@96 | |
783 int v15; // eax@111 | |
784 int v16; // eax@118 | |
785 int v17; // eax@139 | |
786 int v18; // eax@140 | |
787 int v19; // eax@141 | |
788 int v20; // eax@151 | |
564 | 789 //unsigned int v21; // [sp-8h] [bp-20h]@66 |
790 //SpriteObject *v22; // [sp-8h] [bp-20h]@81 | |
791 //unsigned int v23; // [sp-4h] [bp-1Ch]@4 | |
792 //unsigned int v24; // [sp-4h] [bp-1Ch]@5 | |
2334 | 793 // unsigned int v25; // [sp-4h] [bp-1Ch]@30 |
564 | 794 //unsigned int v26; // [sp-4h] [bp-1Ch]@57 |
795 //unsigned int v27; // [sp-4h] [bp-1Ch]@66 | |
796 //int v28; // [sp-4h] [bp-1Ch]@81 | |
797 //unsigned int v29; // [sp+0h] [bp-18h]@4 | |
798 //unsigned int v30; // [sp+0h] [bp-18h]@5 | |
799 //int v31; // [sp+0h] [bp-18h]@30 | |
800 //unsigned int v32; // [sp+0h] [bp-18h]@45 | |
801 //float v33; // [sp+0h] [bp-18h]@57 | |
802 //float v34; // [sp+0h] [bp-18h]@66 | |
803 //signed int v35; // [sp+0h] [bp-18h]@81 | |
0 | 804 char pContainer[7]; // [sp+10h] [bp-8h]@81 |
805 | |
564 | 806 //__debugbreak(); // need to refactor carefully & collect data |
807 //v2 = this; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
808 result = a2->uType; |
564 | 809 |
810 switch (a2->uType) | |
811 { | |
796
14beae4f1723
Last observable issues with walking in dragon cave fixed.
Nomad
parents:
733
diff
changeset
|
812 case 500: // blue rat bolt for example |
14beae4f1723
Last observable issues with walking in dragon cave fixed.
Nomad
parents:
733
diff
changeset
|
813 case 530: |
14beae4f1723
Last observable issues with walking in dragon cave fixed.
Nomad
parents:
733
diff
changeset
|
814 _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
|
815 return false; |
14beae4f1723
Last observable issues with walking in dragon cave fixed.
Nomad
parents:
733
diff
changeset
|
816 |
14beae4f1723
Last observable issues with walking in dragon cave fixed.
Nomad
parents:
733
diff
changeset
|
817 case 510: // dragon fire for example |
14beae4f1723
Last observable issues with walking in dragon cave fixed.
Nomad
parents:
733
diff
changeset
|
818 _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
|
819 return false; |
14beae4f1723
Last observable issues with walking in dragon cave fixed.
Nomad
parents:
733
diff
changeset
|
820 |
567 | 821 case 545: |
564 | 822 case 550: |
823 case 555: return true; | |
824 | |
825 case 556: | |
826 AddMobileLight(a2, 0xFF0000, 256); | |
827 return false; | |
828 | |
829 case 600: | |
830 AddMobileLight(a2, 0xFF3C1E, 256); | |
831 return true; | |
832 | |
833 case 1010: // Fire Bolt | |
834 { | |
835 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xFF3C1E, uTextureID_effpar1); | |
836 AddMobileLight(a2, 0xFF3C1E, 256); | |
837 } | |
838 return false; | |
839 | |
840 case 1011: // Fire Bolt impact | |
841 { | |
842 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1E, uTextureID_effpar1); | |
843 AddMobileLight(a2, 0xFF3C1E, 256); | |
844 } | |
845 return false; | |
846 | |
847 case 1050: // Fireball | |
848 { | |
849 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xFF3C1E, uTextureID_effpar1); | |
850 AddMobileLight(a2, 0xFF3C1E, 256); | |
851 } | |
852 return false; | |
853 | |
854 case 1051: // Fireball hit | |
855 { | |
856 AddMobileLight(a2, 0xFF3C1E, 256); | |
2154 | 857 //if (pRenderer->pRenderD3D) |
564 | 858 { |
848 | 859 result = PID_TYPE(a2->spell_caster_pid); |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
860 if (PID_TYPE(a2->spell_caster_pid) != OBJECT_Actor && |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
861 PID_TYPE(a2->spell_caster_pid) != OBJECT_Item) |
564 | 862 { |
863 if (field_204 != 4) | |
864 { | |
865 field_204++; | |
866 _4A7688_fireball_collision_particle(a2); | |
867 } | |
868 return false; | |
869 } | |
870 } | |
871 } | |
872 return true; | |
873 | |
874 case 1081: | |
875 { | |
876 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xFF3C1E, uTextureID_effpar1, 300.0); | |
877 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xFF3C1E, uTextureID_effpar1, 250.0); | |
878 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xFF3C1E, uTextureID_effpar1, 200.0); | |
879 AddMobileLight(a2, 0xFF3C1E, 256); | |
880 } | |
881 return false; | |
882 | |
883 case 2101: | |
884 { | |
885 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xC8C814, uTextureID_effpar1, 200.0); | |
886 AddMobileLight(a2, 0xC8C814, 256); | |
887 } | |
888 return false; | |
889 | |
890 case 3060: // Acid Burst | |
891 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x0AB450, uTextureID_effpar1); | |
892 AddMobileLight(a2, 0x0AB450, 256); | |
893 return false; | |
894 | |
895 case 9000: return true; | |
896 } | |
897 | |
567 | 898 if ( result < 545 ) |
0 | 899 { |
1705 | 900 //__debugbreak(); // find out what kind of spells are these |
1102 | 901 // when summoned light elemental attacks |
1424 | 902 //cast spell from trees in Avlee |
0 | 903 result -= 500; |
904 switch ( result ) | |
905 { | |
906 case 1: | |
907 case 31: | |
564 | 908 _4A75CC_single_spell_collision_particle(a2, 0xAAAFF, uTextureID_effpar1); |
909 return true; | |
0 | 910 case 5: |
564 | 911 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x5C310E, uTextureID_effpar1); |
912 return false; | |
0 | 913 case 15: |
564 | 914 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x0062D0, uTextureID_effpar1); |
915 return false; | |
0 | 916 case 16: |
564 | 917 _4A75CC_single_spell_collision_particle(a2, 0x0062D0, uTextureID_effpar1); |
918 return false; | |
0 | 919 case 20: |
564 | 920 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x0AB450, uTextureID_effpar1); |
921 return false; | |
0 | 922 case 21: |
564 | 923 _4A75CC_single_spell_collision_particle(a2, 0x0AB450, uTextureID_effpar1); |
924 return false; | |
0 | 925 case 25: |
564 | 926 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xC8C805, uTextureID_effpar1); |
927 return false; | |
0 | 928 case 26: |
564 | 929 _4A75CC_single_spell_collision_particle(a2, 0xC8C805, uTextureID_effpar1); |
930 return false; | |
0 | 931 case 35: |
564 | 932 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xFFFFFF, uTextureID_effpar1); |
933 return false; | |
0 | 934 case 36: |
564 | 935 _4A75CC_single_spell_collision_particle(a2, 0xFFFFFF, uTextureID_effpar1); |
936 return false; | |
937 | |
0 | 938 case 40: |
564 | 939 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x7E7E7E, uTextureID_effpar1); |
940 return false; | |
941 | |
0 | 942 case 11: |
564 | 943 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1E, uTextureID_effpar1); |
944 return false; | |
0 | 945 case 6: |
564 | 946 _4A75CC_single_spell_collision_particle(a2, 0x5C310E, uTextureID_effpar1); |
947 return false; | |
948 | |
0 | 949 case 41: |
564 | 950 _4A75CC_single_spell_collision_particle(a2, 0x7E7E7E, uTextureID_effpar1); |
951 return false; | |
0 | 952 default: |
564 | 953 return false; |
0 | 954 } |
564 | 955 return false; |
0 | 956 } |
564 | 957 |
0 | 958 if ( result <= 4051 ) |
959 { | |
960 if ( result != 4051 ) | |
961 { | |
962 if ( result <= 2031 ) | |
963 { | |
964 if ( result != 2031 ) | |
965 { | |
564 | 966 if ( result < 1051 ) |
0 | 967 { |
564 | 968 if ( result < 600 ) |
0 | 969 { |
564 | 970 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1E, uTextureID_effpar1); |
971 return false; | |
0 | 972 } |
973 if ( result < 811 ) | |
564 | 974 return false; |
0 | 975 if ( result <= 814 ) |
564 | 976 return true; |
977 return false; | |
978 | |
0 | 979 } |
980 if ( result <= 1081 ) | |
981 { | |
564 | 982 if (result != 1081) |
0 | 983 { |
984 result -= 1060; | |
985 if ( !result ) | |
564 | 986 return true; |
0 | 987 v7 = result - 1; |
988 if ( v7 ) | |
989 { | |
990 v8 = v7 - 9; | |
991 if ( !v8 ) | |
992 { | |
564 | 993 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1E, uTextureID_effpar1); |
994 return false; | |
0 | 995 } |
996 result = v8 - 10; | |
997 v9 = result == 0; | |
564 | 998 //LABEL_129: |
0 | 999 if ( v9 ) |
564 | 1000 return true; |
1001 return false; | |
0 | 1002 } |
564 | 1003 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xFF3C1E, uTextureID_effpar1, 250.0); |
1004 AddMobileLight(a2, 0xFF3C1E, 256); | |
1005 return false; | |
0 | 1006 } |
564 | 1007 //LABEL_84: |
1008 // _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, diffuse, v26, v33); | |
1009 //goto LABEL_43; | |
1010 return false; | |
0 | 1011 } |
1012 v10 = result - 1090; | |
1013 if ( v10 ) | |
1014 { | |
1015 result = v10 - 10; | |
1016 if ( !result ) | |
564 | 1017 return true; |
0 | 1018 v11 = result - 1; |
1019 if ( !v11 ) | |
1020 { | |
564 | 1021 //diffuse = 0xFF3C1E; |
1022 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1E, uTextureID_effpar1); | |
1023 //v32 = v2->uTextureID_effpar1; | |
1024 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1E, uTextureID_effpar1); | |
1025 //goto LABEL_43; | |
1026 AddMobileLight(a2, 0xFF3C1E, 256); | |
1027 return false; | |
0 | 1028 } |
1029 result = v11 - 929; | |
1030 if ( result ) | |
564 | 1031 return false; |
1032 //LABEL_63: | |
2154 | 1033 //if ( !pRenderer->pRenderD3D ) |
1034 // return true; | |
0 | 1035 _4A78AE_sparks_spell(a2); |
564 | 1036 AddMobileLight(a2, 0x64640F, 128); |
1037 return false; | |
0 | 1038 } |
564 | 1039 |
1040 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xFF3C1Eu, uTextureID_effpar1, 250.0); | |
1041 return false; | |
0 | 1042 } |
564 | 1043 //goto LABEL_67; |
0 | 1044 } |
564 | 1045 if ( result < 3060 ) |
0 | 1046 { |
564 | 1047 if ( result < 2101 ) |
0 | 1048 { |
1049 if ( result != 2060 ) | |
1050 { | |
1051 if ( result != 2061 ) | |
1052 { | |
1053 if ( result <= 2079 ) | |
564 | 1054 return false; |
0 | 1055 if ( result <= 2081 ) |
1056 { | |
2154 | 1057 //if ( pRenderer->pRenderD3D ) |
1058 _4A77FD_implosion_particle_d3d(a2); | |
1059 /*else | |
1060 _4A80DC_implosion_particle_sw(a2);*/ | |
564 | 1061 return false; |
0 | 1062 } |
1063 v9 = result == 2100; | |
564 | 1064 if ( v9 ) |
1065 return true; | |
1066 return false; | |
0 | 1067 } |
564 | 1068 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xC8C814, uTextureID_effpar2, 200.0); |
1069 AddMobileLight(a2, 0xC8C814, 256); | |
1070 return false; | |
0 | 1071 } |
2154 | 1072 //if ( !pRenderer->pRenderD3D ) |
1073 // return true; | |
0 | 1074 memcpy(pContainer, "sp18h1", 7); |
1075 pRnd->SetRange(1, 6); | |
1076 pContainer[5] = pRnd->GetInRange() + '0'; | |
564 | 1077 AddProjectile(a2, 100, pBitmaps_LOD->LoadTexture(pContainer)); |
1078 return false; | |
0 | 1079 } |
1080 v12 = result - 3010; | |
1081 if ( !v12 ) | |
1082 { | |
564 | 1083 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xAB450, uTextureID_effpar1); |
1084 AddMobileLight(a2, 0xAB450, 256); | |
1085 return false; | |
0 | 1086 } |
1087 v13 = v12 - 1; | |
1088 if ( !v13 ) | |
1089 { | |
564 | 1090 _4A75CC_single_spell_collision_particle(a2, 0xAB450, uTextureID_effpar1); |
1091 AddMobileLight(a2, 0xAB450, 256); | |
1092 return false; | |
0 | 1093 } |
1094 result = v13 - 19; | |
1095 if ( !result ) | |
564 | 1096 return true; |
0 | 1097 --result; |
1098 if ( result ) | |
564 | 1099 return false; |
1100 | |
1101 _4A75CC_single_spell_collision_particle(a2, 0x9EB9F1, uTextureID_effpar1); | |
1102 AddMobileLight(a2, 0x9EB9F1, 256); | |
1103 return false; | |
0 | 1104 } |
1105 if ( result > 4000 ) | |
1106 { | |
1107 result -= 4030; | |
1108 if ( !result || (--result, !result) ) | |
564 | 1109 return true; |
0 | 1110 result -= 19; |
1111 v9 = result == 0; | |
564 | 1112 if ( v9 ) |
1113 return true; | |
1114 return false; | |
0 | 1115 } |
1116 if ( result == 4000 ) | |
1117 { | |
2154 | 1118 //if ( !pRenderer->pRenderD3D ) |
1119 // return true; | |
0 | 1120 _4A7C07(a2); |
564 | 1121 return false; |
0 | 1122 } |
1123 result -= 3061; | |
1124 if ( !result || (result -= 29) == 0 ) | |
564 | 1125 return true; |
0 | 1126 v14 = result - 1; |
1127 if ( !v14 ) | |
564 | 1128 { |
1129 _4A75CC_single_spell_collision_particle(a2, 0x9EB9F1, uTextureID_effpar1); | |
1130 AddMobileLight(a2, 0x9EB9F1, 256); | |
1131 return false; | |
1132 } | |
0 | 1133 result = v14 - 1; |
1134 if ( result ) | |
564 | 1135 return false; |
1136 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x9EB9F1, uTextureID_effpar1); | |
1137 return false; | |
0 | 1138 } |
564 | 1139 _4A7948_mind_blast_after_effect(a2); |
1140 return false; | |
0 | 1141 } |
1142 if ( result <= 7090 ) | |
1143 { | |
1144 if ( result == 7090 ) | |
564 | 1145 return true; |
0 | 1146 if ( result > 6030 ) |
1147 { | |
1148 if ( result > 6091 ) | |
1149 { | |
1150 result -= 6100; | |
1151 if ( !result ) | |
564 | 1152 return true; |
0 | 1153 result -= 930; |
1154 if ( result ) | |
1155 { | |
1156 --result; | |
564 | 1157 if (!result) |
1158 _4A75CC_single_spell_collision_particle(a2, 0xF00000, uTextureID_effpar1); | |
1159 return false; | |
0 | 1160 } |
2154 | 1161 //if ( !pRenderer->pRenderD3D ) |
1162 // return true; | |
564 | 1163 _4A78AE_sparks_spell(a2); |
1164 AddMobileLight(a2, 0x64640F, 128); | |
1165 return false; | |
0 | 1166 } |
1167 if ( result != 6091 ) | |
1168 { | |
1169 result -= 6040; | |
1170 if ( !result || (result -= 20) == 0 || (result -= 10) == 0 ) | |
564 | 1171 return true; |
0 | 1172 result -= 20; |
1173 v9 = result == 0; | |
564 | 1174 if ( v9 ) |
1175 return true; | |
1176 return false; | |
0 | 1177 } |
1178 } | |
1179 else | |
1180 { | |
1181 if ( result == 6030 ) | |
564 | 1182 return true; |
0 | 1183 if ( result <= 4091 ) |
1184 { | |
1185 if ( result != 4091 ) | |
1186 { | |
1187 result -= 4070; | |
1188 if ( !result ) | |
564 | 1189 return true; |
0 | 1190 v15 = result - 1; |
1191 if ( v15 ) | |
1192 { | |
1193 result = v15 - 9; | |
1194 if ( !result ) | |
564 | 1195 return true; |
0 | 1196 result -= 10; |
1197 if ( !result ) | |
1198 { | |
564 | 1199 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x7E7E7E, uTextureID_effpar1); |
1200 return true; | |
0 | 1201 } |
564 | 1202 return false; |
0 | 1203 } |
564 | 1204 _4A75CC_single_spell_collision_particle(a2, 0x5C310E, uTextureID_effpar1); |
1205 return false; | |
0 | 1206 } |
564 | 1207 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0x7E7E7E, uTextureID_effpar1, 200.0); |
1208 return false; | |
0 | 1209 } |
1210 v16 = result - 4092; | |
1211 if ( !v16 ) | |
1212 { | |
564 | 1213 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x7E7E7E, uTextureID_effpar1); |
1214 return false; | |
0 | 1215 } |
1216 result = v16 - 8; | |
1217 if ( !result ) | |
564 | 1218 return false; |
0 | 1219 result -= 1910; |
1220 if ( !result ) | |
564 | 1221 return true; |
0 | 1222 --result; |
1223 if ( result ) | |
564 | 1224 return false; |
0 | 1225 } |
564 | 1226 //LABEL_122: |
0 | 1227 _4A7948_mind_blast_after_effect(a2); |
564 | 1228 return false; |
0 | 1229 } |
1230 if ( result <= 9000 ) | |
1231 { | |
1232 if ( result <= 8030 ) | |
1233 { | |
1234 if ( result == 8030 ) | |
564 | 1235 return true; |
0 | 1236 v17 = result - 7091; |
1237 if ( v17 ) | |
1238 { | |
1239 v18 = v17 - 909; | |
1240 if ( !v18 ) | |
1241 { | |
564 | 1242 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xFFFFFF, uTextureID_effpar3); |
1243 AddMobileLight(a2, 0xFFFFFF, 128); | |
1244 return false; | |
0 | 1245 } |
1246 v19 = v18 - 1; | |
1247 if ( v19 ) | |
1248 { | |
1249 result = v19 - 9; | |
1250 if ( !result ) | |
1251 { | |
564 | 1252 AddMobileLight(a2, 0xFFFFFF, 64); |
1253 return false; | |
0 | 1254 } |
564 | 1255 return false; |
0 | 1256 } |
564 | 1257 _4A75CC_single_spell_collision_particle(a2, 0xFFFFFF, uTextureID_effpar2); |
1258 AddMobileLight(a2, 0xFFFFFF, 256); | |
1259 return false; | |
0 | 1260 } |
1261 else | |
1262 { | |
564 | 1263 _4A75CC_single_spell_collision_particle(a2, 0xF00000, uTextureID_effpar1); |
1264 AddMobileLight(a2, 0xF00000, 256); | |
1265 return false; | |
0 | 1266 } |
1267 } | |
1268 result -= 8040; | |
1269 if ( !result || (result -= 20) == 0 ) | |
564 | 1270 return true; |
0 | 1271 v20 = result - 30; |
1272 if ( v20 ) | |
1273 { | |
1274 result = v20 - 1; | |
1275 if ( result ) | |
564 | 1276 return false; |
1277 | |
1278 _4A75CC_single_spell_collision_particle(a2, 0xFFFFFF, uTextureID_effpar3); | |
1279 return false; | |
0 | 1280 } |
564 | 1281 AddMobileLight(a2, 0xFFFFFFu, 128); |
2154 | 1282 //if ( !pRenderer->pRenderD3D ) |
1283 // return true; | |
564 | 1284 AddProjectile(a2, 100, -1); |
1285 return false; | |
0 | 1286 } |
1287 if ( result > 9050 ) | |
1288 { | |
1289 result -= 9070; | |
1290 if ( !result || (result -= 10) == 0 || (--result, !result) ) | |
564 | 1291 return true; |
1292 return false; | |
0 | 1293 } |
1294 if ( result == 9050 || (result -= 9010) == 0 || (result -= 20) == 0 || (result -= 10) == 0 ) | |
564 | 1295 return true; |
0 | 1296 --result; |
1297 if ( !result ) | |
1298 { | |
564 | 1299 //LABEL_164: |
1300 _4A75CC_single_spell_collision_particle(a2, 0x7E7E7E, uTextureID_effpar1); | |
1301 return false; | |
0 | 1302 } |
564 | 1303 //LABEL_168: |
1304 return false; | |
0 | 1305 } |
1306 | |
1307 //----- (004A89BD) -------------------------------------------------------- | |
486 | 1308 void stru6::SetPlayerBuffAnim(unsigned __int16 uSpellID, unsigned __int16 uPlayerID) |
0 | 1309 { |
486 | 1310 //stru6 *v3; // edi@1 |
0 | 1311 PlayerBuffAnim *v4; // esi@1 |
1312 const char *v6; // [sp-4h] [bp-10h]@2 | |
1313 | |
486 | 1314 v4 = &pPlayerBuffs[uPlayerID]; |
491 | 1315 v4->uSpellAnimTimeElapsed = 0; |
486 | 1316 v4->bRender = uSpellID != 0; |
1317 | |
1318 switch (uSpellID) | |
0 | 1319 { |
920 | 1320 case SPELL_DISEASE: |
0 | 1321 v6 = "zapp"; |
486 | 1322 break; |
1323 | |
495 | 1324 case BECOME_MAGIC_GUILD_MEMBER: |
0 | 1325 case SPELL_AIR_FEATHER_FALL: |
1326 case SPELL_SPIRIT_DETECT_LIFE: | |
486 | 1327 case SPELL_SPIRIT_FATE: |
0 | 1328 v6 = "spboost1"; |
486 | 1329 break; |
1330 | |
501 | 1331 case SPELL_QUEST_COMPLETED: |
486 | 1332 case SPELL_AIR_INVISIBILITY: |
0 | 1333 case SPELL_WATER_WATER_WALK: |
486 | 1334 case SPELL_SPIRIT_PRESERVATION: |
0 | 1335 v6 = "spboost2"; |
486 | 1336 break; |
1337 | |
488 | 1338 case SPELL_152: |
486 | 1339 __debugbreak(); // spell id == 152 wtf |
1340 case SPELL_LIGHT_HOUR_OF_POWER: | |
1341 case SPELL_LIGHT_DAY_OF_THE_GODS: | |
1342 case SPELL_LIGHT_DAY_OF_PROTECTION: | |
1343 case SPELL_LIGHT_DIVINE_INTERVENTION: | |
0 | 1344 v6 = "spboost3"; |
486 | 1345 break; |
1346 | |
1347 case SPELL_SPIRIT_REMOVE_CURSE: | |
0 | 1348 case SPELL_MIND_REMOVE_FEAR: |
1349 case SPELL_BODY_CURE_WEAKNESS: | |
1350 v6 = "spheal1"; | |
486 | 1351 break; |
1352 | |
1353 case SPELL_SPIRIT_SHARED_LIFE: | |
0 | 1354 case SPELL_MIND_CURE_PARALYSIS: |
486 | 1355 case SPELL_MIND_CURE_INSANITY: |
0 | 1356 case SPELL_BODY_FIRST_AID: |
1357 case SPELL_BODY_CURE_POISON: | |
1358 case SPELL_BODY_CURE_DISEASE: | |
486 | 1359 case SPELL_DARK_SACRIFICE: |
0 | 1360 v6 = "spheal2"; |
486 | 1361 break; |
1362 | |
1363 case SPELL_BODY_POWER_CURE: | |
1364 case SPELL_DARK_SOULDRINKER: | |
0 | 1365 v6 = "spheal3"; |
486 | 1366 break; |
1367 | |
0 | 1368 case SPELL_FIRE_PROTECTION_FROM_FIRE: |
486 | 1369 case SPELL_FIRE_IMMOLATION: |
0 | 1370 v6 = "spell03"; |
486 | 1371 break; |
1372 | |
1373 case SPELL_FIRE_HASTE: v6 = "spell05"; break; | |
1374 case SPELL_AIR_PROTECTION_FROM_AIR: v6 = "spell14"; break; | |
1375 case SPELL_AIR_SHIELD: v6 = "spell17"; break; | |
1376 case SPELL_WATER_PROTECTION_FROM_WATER: v6 = "spell25"; break; | |
1377 case SPELL_EARTH_PROTECTION_FROM_EARTH: v6 = "spell36"; break; | |
1378 case SPELL_EARTH_STONESKIN: v6 = "spell38"; break; | |
1379 case SPELL_SPIRIT_BLESS: v6 = "spell46"; break; | |
1380 case SPELL_SPIRIT_HEROISM: v6 = "spell51"; break; | |
1381 case SPELL_SPIRIT_RESSURECTION: v6 = "spell55"; break; | |
1382 case SPELL_MIND_PROTECTION_FROM_MIND: v6 = "spell58"; break; | |
1383 case SPELL_BODY_PROTECTION_FROM_BODY: v6 = "spell69"; break; | |
1384 case SPELL_BODY_REGENERATION: v6 = "spell71"; break; | |
1385 case SPELL_BODY_HAMMERHANDS: v6 = "spell73"; break; | |
1386 case SPELL_BODY_PROTECTION_FROM_MAGIC: v6 = "spell75"; break; | |
1387 | |
0 | 1388 default: |
486 | 1389 v4->bRender = false; |
1390 return; | |
0 | 1391 } |
486 | 1392 |
1393 v4->uSpellIconID = pIconsFrameTable->FindIcon(v6); | |
1394 if (v4->bRender) | |
1395 v4->uSpellAnimTime = 8 * pIconsFrameTable->pIcons[v4->uSpellIconID].uAnimLength; | |
0 | 1396 } |
1397 | |
1398 //----- (004A8BDF) -------------------------------------------------------- | |
1399 void stru6::FadeScreen__like_Turn_Undead_and_mb_Armageddon(unsigned int uDiffuseColor, unsigned int uFadeTime) | |
1400 { | |
1401 this->uFadeTime = uFadeTime; | |
2155 | 1402 this->uFadeLength = uFadeTime; |
0 | 1403 this->uFadeColor = uDiffuseColor; |
1404 } | |
1405 | |
1406 //----- (004A8BFC) -------------------------------------------------------- | |
2188 | 1407 int stru6::_4A8BFC() //for SPELL_LIGHT_PRISMATIC_LIGHT |
0 | 1408 { |
1390 | 1409 uAnimLength = 8 * pSpriteFrameTable->pSpriteSFrames[pSpriteFrameTable->FastFindSprite("spell84")].uAnimLength; |
1410 return uAnimLength; | |
0 | 1411 } |
1412 | |
1413 //----- (004A8C27) -------------------------------------------------------- | |
1414 void stru6::RenderSpecialEffects() | |
1415 { | |
1416 double v4; // st7@4 | |
1417 double v5; // st6@4 | |
1418 float v7; // ST14_4@6 | |
1419 unsigned int v8; // ST14_4@8 | |
1420 SpriteFrame *v10; // eax@8 | |
1421 int v11; // edi@8 | |
1422 RenderVertexD3D3 vd3d[4]; // [sp+60h] [bp-8Ch]@9 | |
1423 | |
1424 if (uNumProjectiles) | |
1425 { | |
1426 DrawProjectiles(); | |
1427 uNumProjectiles = 0; | |
1428 } | |
1429 | |
1430 field_204 = 0; | |
2155 | 1431 if ( uFadeTime > 0 ) |
0 | 1432 { |
2155 | 1433 v4 = (double)uFadeTime / (double)uFadeLength; |
0 | 1434 v5 = 1.0 - v4 * v4; |
2155 | 1435 //v6 = v5; |
0 | 1436 if ( v5 > 0.9 ) |
2155 | 1437 v5 = 1.0 - (v5 - 0.9) * 10.0; |
1438 v7 = v5; | |
1439 pRenderer->ScreenFade(uFadeColor, v7); | |
0 | 1440 uFadeTime -= pEventTimer->uTimeElapsed; |
1441 } | |
1442 | |
2425 | 1443 if (uAnimLength > 0) |
0 | 1444 { |
2425 | 1445 v8 = 8 * pSpriteFrameTable->pSpriteSFrames[pSpriteFrameTable->FastFindSprite("spell84")].uAnimLength - uAnimLength; |
1446 v10 = pSpriteFrameTable->GetFrame(pSpriteFrameTable->FastFindSprite("spell84"), v8); | |
0 | 1447 v11 = v10->pHwSpriteIDs[0]; |
1448 uAnimLength -= pEventTimer->uTimeElapsed; | |
2154 | 1449 //if ( pRenderer->pRenderD3D ) |
2425 | 1450 //{ |
1451 vd3d[0].pos.x = (double)(signed int)pViewport->uViewportTL_X; | |
1452 vd3d[0].pos.y = (double)(signed int)pViewport->uViewportTL_Y; | |
1453 vd3d[0].pos.z = 0.0; | |
0 | 1454 vd3d[0].diffuse = 0x7F7F7Fu; |
2425 | 1455 vd3d[0].specular = 0; |
1456 vd3d[0].rhw = 1.0; | |
1457 vd3d[0].texcoord.x = 0.0; | |
1458 vd3d[0].texcoord.y = 0.0; | |
1459 | |
1460 vd3d[1].pos.x = (double)(signed int)pViewport->uViewportTL_X; | |
1461 vd3d[1].pos.y = (double)(pViewport->uViewportBR_Y + 1); | |
1462 vd3d[1].pos.z = 0.0; | |
0 | 1463 vd3d[1].diffuse = 0x7F7F7Fu; |
2425 | 1464 vd3d[1].specular = 0; |
1465 vd3d[1].rhw = 1.0; | |
1466 vd3d[1].texcoord.x = 0.0; | |
1467 vd3d[1].texcoord.y = 1.0; | |
1468 | |
1469 vd3d[2].pos.x = (double)(signed int)pViewport->uViewportBR_X; | |
1470 vd3d[2].pos.y = (double)(pViewport->uViewportBR_Y + 1); | |
1471 vd3d[2].pos.z = 0.0; | |
0 | 1472 vd3d[2].diffuse = 0x7F7F7Fu; |
2425 | 1473 vd3d[2].specular = 0; |
1474 vd3d[2].rhw = 1.0; | |
1475 vd3d[2].texcoord.x = 1.0; | |
1476 vd3d[2].texcoord.y = 1.0; | |
1477 | |
1478 vd3d[3].pos.x = (double)(signed int)pViewport->uViewportBR_X; | |
1479 vd3d[3].pos.y = (double)(signed int)pViewport->uViewportTL_Y; | |
1480 vd3d[3].pos.z = 0.0; | |
0 | 1481 vd3d[3].diffuse = 0x7F7F7Fu; |
1482 vd3d[3].specular = 0; | |
1483 vd3d[3].rhw = 1.0; | |
1484 vd3d[3].texcoord.x = 1.0; | |
1485 vd3d[3].texcoord.y = 0.0; | |
2155 | 1486 |
1487 pRenderer->DrawSpecialEffectsQuad(vd3d, pSprites_LOD->pHardwareSprites[v11].pTexture); | |
2425 | 1488 //} |
2154 | 1489 /*else |
0 | 1490 { |
1491 vsr.pTarget = pRenderer->pTargetSurface; | |
2002 | 1492 vsr.sParentBillboardID = -1; |
0 | 1493 vsr.pTargetZ = pRenderer->pActiveZBuffer; |
693 | 1494 vsr.uScreenSpaceX = (signed int)(pViewport->uViewportBR_X - pViewport->uViewportTL_X) / 2; |
1495 vsr.uScreenSpaceY = pViewport->uViewportBR_Y; | |
0 | 1496 v24 = 16777216; |
1497 LODWORD(v18) = 0; | |
693 | 1498 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
|
1499 vsr._screenspace_x_scaler_packedfloat = v18 / 0x1000000; |
0 | 1500 LODWORD(v18) = 0; |
693 | 1501 HIDWORD(v18) = (signed __int16)(LOWORD(pViewport->uViewportBR_Y) - LOWORD(pViewport->uViewportTL_Y)); |
0 | 1502 v26 = v18 / 16777216; |
144
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
142
diff
changeset
|
1503 vsr._screenspace_y_scaler_packedfloat = v18 / 0x1000000; |
0 | 1504 vsr.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v70->uPaletteIndex, 0, 1); |
1505 vsr.uTargetPitch = pRenderer->uTargetSurfacePitch; | |
2002 | 1506 vsr.sParentBillboardID = -1; |
693 | 1507 vsr.uViewportX = pViewport->uViewportTL_X; |
1508 vsr.uViewportZ = pViewport->uViewportBR_X; | |
1509 vsr.uViewportY = pViewport->uViewportTL_Y; | |
0 | 1510 vsr.sZValue = 0; |
693 | 1511 vsr.uViewportW = pViewport->uViewportBR_Y; |
0 | 1512 vsr.uFlags = 0; |
1513 if ( v11 >= 0 ) | |
733 | 1514 pSprites_LOD->pSpriteHeaders[v11].DrawSprite_sw(&vsr, 1); |
2154 | 1515 }*/ |
0 | 1516 } |
1517 } | |
1518 | |
1519 //----- (004A902A) -------------------------------------------------------- | |
1520 void stru6::DrawPlayerBuffAnims() | |
1521 { | |
491 | 1522 for (uint i = 0; i < 4; ++i) |
1523 { | |
1980 | 1524 PlayerBuffAnim* buff = &pPlayerBuffs[i]; |
491 | 1525 if (!buff->bRender) |
1526 continue; | |
0 | 1527 |
491 | 1528 buff->uSpellAnimTimeElapsed += pEventTimer->uTimeElapsed; |
1529 if (buff->uSpellAnimTimeElapsed >= buff->uSpellAnimTime) | |
0 | 1530 { |
491 | 1531 buff->bRender = false; |
1532 continue; | |
0 | 1533 } |
491 | 1534 |
1980 | 1535 IconFrame* icon = pIconsFrameTable->GetFrame(buff->uSpellIconID, buff->uSpellAnimTimeElapsed); |
2524 | 1536 pRenderer->DrawTextureIndexedAlpha(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 385, pIcons_LOD->GetTexture(icon->uTextureID)); |
491 | 1537 |
1538 pOtherOverlayList->bRedraw = true; | |
0 | 1539 } |
1540 } | |
1541 | |
1542 //----- (004A90A0) -------------------------------------------------------- | |
1543 void stru6::LoadAnimations() | |
1544 { | |
1545 uTextureID_effpar1 = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT); | |
1546 uTextureID_effpar2 = pBitmaps_LOD->LoadTexture("effpar02", TEXTURE_DEFAULT); | |
1547 uTextureID_effpar3 = pBitmaps_LOD->LoadTexture("effpar03", TEXTURE_DEFAULT); | |
1548 uSpriteID_sp57c = pSprites_LOD->LoadSprite("sp57c", 6); | |
1390 | 1549 |
1550 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("zapp")); | |
1551 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spheal1")); | |
1552 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spheal2")); | |
1553 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spheal3")); | |
1554 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spboost1")); | |
1555 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spboost2")); | |
1556 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spboost3")); | |
1557 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell03")); | |
1558 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell05")); | |
1559 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell14")); | |
1560 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell17")); | |
1561 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell21")); | |
1562 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell25")); | |
1563 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell27")); | |
1564 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell36")); | |
1565 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell38")); | |
1566 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell46")); | |
1567 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell51")); | |
1568 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell55")); | |
1569 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell58")); | |
1570 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell69")); | |
1571 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell71")); | |
1572 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell73")); | |
1573 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell75")); | |
1574 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell96")); | |
0 | 1575 |
1390 | 1576 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell01")); |
1577 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell02")); | |
1578 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell03")); | |
1579 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell09")); | |
1580 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell11")); | |
1581 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell18")); | |
1582 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell22")); | |
1583 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell26")); | |
1584 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell29")); | |
1585 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell39")); | |
1586 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell39c")); | |
1587 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell41")); | |
1588 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell57c")); | |
1589 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell62")); | |
1590 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell65")); | |
1591 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell66")); | |
1592 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell70")); | |
1593 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell76")); | |
1594 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell84")); | |
1595 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell90")); | |
1596 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell92")); | |
1597 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell93")); | |
1598 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell97")); | |
1599 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell97c")); | |
1600 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell97c")); | |
0 | 1601 } |
2464 | 1602 |
1603 //----- (004775ED) -------------------------------------------------------- | |
1604 int stru6_stru1_indoor_sw_billboard::_4775ED(float a2) | |
1605 { | |
1606 char *v2; // edi@1 | |
1607 //int v3; // eax@1 | |
1608 char *v4; // edx@2 | |
1609 char *v5; // esi@3 | |
1610 double v6; // st7@6 | |
1611 signed __int64 v7; // ST84_8@6 | |
1612 double v8; // ST0C_8@6 | |
1613 int v9; // esi@6 | |
1614 double v10; // ST44_8@6 | |
1615 int v11; // ecx@6 | |
1616 double v12; // ST34_8@6 | |
1617 int v13; // ecx@6 | |
1618 double v14; // ST14_8@6 | |
1619 double v15; // st7@8 | |
1620 unsigned int v16; // ecx@8 | |
1621 signed __int64 v17; // ST64_8@8 | |
1622 double v18; // ST24_8@8 | |
1623 int v19; // edi@8 | |
1624 double v20; // ST3C_8@8 | |
1625 int v21; // ecx@8 | |
1626 double v22; // ST2C_8@8 | |
1627 int v23; // ST9C_4@8 | |
1628 double v24; // ST1C_8@8 | |
1629 int *v25; // edi@8 | |
1630 int v26; // esi@8 | |
1631 int *v27; // edi@10 | |
1632 int v28; // esi@10 | |
1633 // int result; // eax@12 | |
1634 __int64 v30; // [sp+A8h] [bp-30h]@8 | |
1635 float v31; // [sp+B0h] [bp-28h]@6 | |
1636 float v32; // [sp+B4h] [bp-24h]@6 | |
1637 int v33; // [sp+B8h] [bp-20h]@6 | |
1638 int v34; // [sp+BCh] [bp-1Ch]@2 | |
1639 stru6_stru1_indoor_sw_billboard *v35; // [sp+C0h] [bp-18h]@1 | |
1640 float v36; // [sp+C4h] [bp-14h]@6 | |
1641 int v37; // [sp+C8h] [bp-10h]@6 | |
1642 int v38; // [sp+CCh] [bp-Ch]@1 | |
1643 float v39; // [sp+D0h] [bp-8h]@6 | |
1644 int *v40; // [sp+D4h] [bp-4h]@2 | |
1645 | |
1646 // __debugbreak();//нужно почистить, срабатывает при применении закла Точечный взрыв и при стрельбе из жезла | |
1647 v2 = (char *)&this->field_64[4 * this->uNumVertices]; | |
1648 v38 = 0; | |
1649 *(int *)v2 = this->field_64[0]; | |
1650 v2 += 4; | |
1651 *(int *)v2 = this->field_64[1]; | |
1652 v2 += 4; | |
1653 *(int *)v2 = this->field_64[2]; | |
1654 *((int *)v2 + 1) = this->field_64[3]; | |
1655 //v3 = this->uNumVertices; | |
1656 v35 = this; | |
1657 if (this->uNumVertices > 0) | |
1658 { | |
1659 v40 = &this->field_64[20]; | |
1660 v4 = (char *)&this->field_64[3] + 3; | |
1661 | |
1662 //while ( 1 ) | |
1663 for (v34 = this->uNumVertices; v34; --v34) | |
1664 { | |
1665 v5 = v4 - 15; | |
1666 if (*(float *)(v4 - 15) <= (double)a2 && *(float *)(v4 + 1) <= (double)a2) | |
1667 { | |
1668 v4 += 16; | |
1669 //--v34; | |
1670 //if ( !v34 ) | |
1671 //return this->uNumVertices = v38; | |
1672 continue; | |
1673 } | |
1674 if (*(float *)v5 <= (double)a2) | |
1675 { | |
1676 v6 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5); | |
1677 v7 = (unsigned __int8)v4[16] - (unsigned int)(unsigned __int8)*v4; | |
1678 v36 = v6; | |
1679 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v6 + *(float *)(v4 - 11); | |
1680 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v6 + *(float *)(v4 - 7); | |
1681 *(float *)&v37 = (double)v7 * v6; | |
1682 v8 = *(float *)&v37 + 6.7553994e15; | |
1683 v9 = (unsigned __int8)*v4; | |
1684 *(float *)&v37 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36; | |
1685 v10 = *(float *)&v37 + 6.7553994e15; | |
1686 v11 = (unsigned __int8)*(v4 - 2); | |
1687 v37 = LODWORD(v10) + (unsigned __int8)*(v4 - 1); | |
1688 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v11) * v36; | |
1689 v12 = v39 + 6.7553994e15; | |
1690 v13 = LODWORD(v12) + (unsigned __int8)*(v4 - 2); | |
1691 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36; | |
1692 v14 = v39 + 6.7553994e15; | |
1693 v33 = (LODWORD(v14) + (*(int *)(v4 - 3) & 0xFF)) | ((v13 | ((v37 | ((LODWORD(v8) + v9) << 8)) << 8)) << 8); | |
1694 //this = v35; | |
1695 v5 = (char *)&v30 + 4; | |
1696 } | |
1697 else if (*(float *)(v4 + 1) <= (double)a2) | |
1698 { | |
1699 v15 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5); | |
1700 v16 = (unsigned __int8)*v4; | |
1701 HIDWORD(v30) = LODWORD(a2); | |
1702 v17 = (unsigned __int8)v4[16] - v16; | |
1703 v36 = v15; | |
1704 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v15 + *(float *)(v4 - 11); | |
1705 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v15 + *(float *)(v4 - 7); | |
1706 v39 = (double)v17 * v15; | |
1707 v18 = v39 + 6.7553994e15; | |
1708 v19 = (unsigned __int8)*v4; | |
1709 v39 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36; | |
1710 v20 = v39 + 6.7553994e15; | |
1711 v21 = (unsigned __int8)*(v4 - 2); | |
1712 v37 = LODWORD(v20) + (unsigned __int8)*(v4 - 1); | |
1713 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v21) * v36; | |
1714 v22 = v39 + 6.7553994e15; | |
1715 v23 = LODWORD(v22) + (unsigned __int8)*(v4 - 2); | |
1716 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36; | |
1717 v24 = v39 + 6.7553994e15; | |
1718 v33 = (LODWORD(v24) + (*(int *)(v4 - 3) & 0xFF)) | ((v23 | ((v37 | ((LODWORD(v18) + v19) << 8)) << 8)) << 8); | |
1719 v25 = v40; | |
1720 *v40 = *(int *)v5; | |
1721 v26 = (int)(v5 + 4); | |
1722 ++v25; | |
1723 *v25 = *(int *)v26; | |
1724 v26 += 4; | |
1725 ++v25; | |
1726 ++v38; | |
1727 v40 += 4; | |
1728 *v25 = *(int *)v26; | |
1729 v25[1] = *(int *)(v26 + 4); | |
1730 v5 = (char *)&v30 + 4; | |
1731 } | |
1732 v27 = v40; | |
1733 ++v38; | |
1734 *v40 = *(int *)v5; | |
1735 v28 = (int)(v5 + 4); | |
1736 ++v27; | |
1737 *v27 = *(int *)v28; | |
1738 v28 += 4; | |
1739 ++v27; | |
1740 v40 += 4; | |
1741 *v27 = *(int *)v28; | |
1742 v27[1] = *(int *)(v28 + 4); | |
1743 v4 += 16; | |
1744 //--v34; | |
1745 //if ( !v34 ) | |
1746 //return this->uNumVertices = v38; | |
1747 } | |
1748 } | |
1749 return this->uNumVertices = v38; | |
1750 } | |
1751 | |
1752 //----- (00477927) -------------------------------------------------------- | |
1753 int stru6_stru1_indoor_sw_billboard::_477927(float a2) | |
1754 { | |
1755 char *v2; // edi@1 | |
1756 int v3; // eax@1 | |
1757 char *v4; // edx@2 | |
1758 char *v5; // esi@3 | |
1759 double v6; // st7@6 | |
1760 signed __int64 v7; // ST84_8@6 | |
1761 double v8; // ST0C_8@6 | |
1762 int v9; // esi@6 | |
1763 double v10; // ST44_8@6 | |
1764 int v11; // ecx@6 | |
1765 double v12; // ST34_8@6 | |
1766 int v13; // ecx@6 | |
1767 double v14; // ST14_8@6 | |
1768 double v15; // st7@8 | |
1769 unsigned int v16; // ecx@8 | |
1770 signed __int64 v17; // ST64_8@8 | |
1771 double v18; // ST24_8@8 | |
1772 int v19; // edi@8 | |
1773 double v20; // ST3C_8@8 | |
1774 int v21; // ecx@8 | |
1775 double v22; // ST2C_8@8 | |
1776 int v23; // ST9C_4@8 | |
1777 double v24; // ST1C_8@8 | |
1778 int *v25; // edi@8 | |
1779 int v26; // esi@8 | |
1780 int *v27; // edi@10 | |
1781 int v28; // esi@10 | |
1782 // int result; // eax@12 | |
1783 __int64 v30; // [sp+A8h] [bp-30h]@8 | |
1784 float v31; // [sp+B0h] [bp-28h]@6 | |
1785 float v32; // [sp+B4h] [bp-24h]@6 | |
1786 int v33; // [sp+B8h] [bp-20h]@6 | |
1787 int v34; // [sp+BCh] [bp-1Ch]@2 | |
1788 stru6_stru1_indoor_sw_billboard *v35; // [sp+C0h] [bp-18h]@1 | |
1789 float v36; // [sp+C4h] [bp-14h]@6 | |
1790 int v37; // [sp+C8h] [bp-10h]@6 | |
1791 int v38; // [sp+CCh] [bp-Ch]@1 | |
1792 float v39; // [sp+D0h] [bp-8h]@6 | |
1793 int *v40; // [sp+D4h] [bp-4h]@2 | |
1794 | |
1795 __debugbreak();//нужно почистить | |
1796 v2 = (char *)&this->field_64[4 * this->uNumVertices]; | |
1797 v38 = 0; | |
1798 *(int *)v2 = this->field_64[0]; | |
1799 v2 += 4; | |
1800 *(int *)v2 = this->field_64[1]; | |
1801 v2 += 4; | |
1802 *(int *)v2 = this->field_64[2]; | |
1803 *((int *)v2 + 1) = this->field_64[3]; | |
1804 v3 = this->uNumVertices; | |
1805 v35 = this; | |
1806 if (v3 > 0) | |
1807 { | |
1808 v40 = &this->field_64[20]; | |
1809 v4 = (char *)&this->field_64[3] + 3; | |
1810 v34 = v3; | |
1811 while (1) | |
1812 { | |
1813 v5 = v4 - 15; | |
1814 if (*(float *)(v4 - 15) >= (double)a2 && *(float *)(v4 + 1) >= (double)a2) | |
1815 { | |
1816 v4 += 16; | |
1817 --v34; | |
1818 if (!v34) | |
1819 return this->uNumVertices = v38; | |
1820 continue; | |
1821 } | |
1822 if (*(float *)v5 >= (double)a2) | |
1823 { | |
1824 v6 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5); | |
1825 v7 = (unsigned __int8)v4[16] - (unsigned int)(unsigned __int8)*v4; | |
1826 v36 = v6; | |
1827 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v6 + *(float *)(v4 - 11); | |
1828 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v6 + *(float *)(v4 - 7); | |
1829 *(float *)&v37 = (double)v7 * v6; | |
1830 v8 = *(float *)&v37 + 6.7553994e15; | |
1831 v9 = (unsigned __int8)*v4; | |
1832 *(float *)&v37 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36; | |
1833 v10 = *(float *)&v37 + 6.7553994e15; | |
1834 v11 = (unsigned __int8)*(v4 - 2); | |
1835 v37 = LODWORD(v10) + (unsigned __int8)*(v4 - 1); | |
1836 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v11) * v36; | |
1837 v12 = v39 + 6.7553994e15; | |
1838 v13 = LODWORD(v12) + (unsigned __int8)*(v4 - 2); | |
1839 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36; | |
1840 v14 = v39 + 6.7553994e15; | |
1841 v33 = (LODWORD(v14) + (*(int *)(v4 - 3) & 0xFF)) | ((v13 | ((v37 | ((LODWORD(v8) + v9) << 8)) << 8)) << 8); | |
1842 //this = v35; | |
1843 v5 = (char *)&v30 + 4; | |
1844 } | |
1845 else if (*(float *)(v4 + 1) >= (double)a2) | |
1846 { | |
1847 v15 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5); | |
1848 v16 = (unsigned __int8)*v4; | |
1849 HIDWORD(v30) = LODWORD(a2); | |
1850 v17 = (unsigned __int8)v4[16] - v16; | |
1851 v36 = v15; | |
1852 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v15 + *(float *)(v4 - 11); | |
1853 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v15 + *(float *)(v4 - 7); | |
1854 v39 = (double)v17 * v15; | |
1855 v18 = v39 + 6.7553994e15; | |
1856 v19 = (unsigned __int8)*v4; | |
1857 v39 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36; | |
1858 v20 = v39 + 6.7553994e15; | |
1859 v21 = (unsigned __int8)*(v4 - 2); | |
1860 v37 = LODWORD(v20) + (unsigned __int8)*(v4 - 1); | |
1861 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v21) * v36; | |
1862 v22 = v39 + 6.7553994e15; | |
1863 v23 = LODWORD(v22) + (unsigned __int8)*(v4 - 2); | |
1864 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36; | |
1865 v24 = v39 + 6.7553994e15; | |
1866 v33 = (LODWORD(v24) + (*(int *)(v4 - 3) & 0xFF)) | ((v23 | ((v37 | ((LODWORD(v18) + v19) << 8)) << 8)) << 8); | |
1867 v25 = v40; | |
1868 *v40 = *(int *)v5; | |
1869 v26 = (int)(v5 + 4); | |
1870 ++v25; | |
1871 *v25 = *(int *)v26; | |
1872 v26 += 4; | |
1873 ++v25; | |
1874 ++v38; | |
1875 v40 += 4; | |
1876 *v25 = *(int *)v26; | |
1877 v25[1] = *(int *)(v26 + 4); | |
1878 v5 = (char *)&v30 + 4; | |
1879 } | |
1880 v27 = v40; | |
1881 ++v38; | |
1882 *v40 = *(int *)v5; | |
1883 v28 = (int)(v5 + 4); | |
1884 ++v27; | |
1885 *v27 = *(int *)v28; | |
1886 v28 += 4; | |
1887 ++v27; | |
1888 v40 += 4; | |
1889 *v27 = *(int *)v28; | |
1890 v27[1] = *(int *)(v28 + 4); | |
1891 v4 += 16; | |
1892 --v34; | |
1893 if (!v34) | |
1894 return this->uNumVertices = v38; | |
1895 } | |
1896 } | |
1897 return this->uNumVertices = v38; | |
1898 } | |
1899 | |
1900 //----- (00477C61) -------------------------------------------------------- | |
1901 int stru6_stru1_indoor_sw_billboard::sub_477C61() | |
1902 { | |
1903 //stru6_stru1_indoor_sw_billboard *v1; // ebx@1 | |
1904 int v2; // ecx@2 | |
1905 int v3; // eax@3 | |
1906 double v4; // st7@4 | |
1907 double v5; // st7@5 | |
1908 double v6; // st6@5 | |
1909 double v7; // st5@6 | |
1910 float v8; // ST30_4@8 | |
1911 float v9; // ST24_4@8 | |
1912 double v10; // st7@8 | |
1913 double v11; // st6@8 | |
1914 double v12; // st5@8 | |
1915 float v13; // ST24_4@13 | |
1916 int v14; // esi@13 | |
1917 char *v15; // esi@15 | |
1918 //signed int v16; // eax@16 | |
1919 // __int16 v17; // fps@16 | |
1920 // unsigned __int8 v18; // c2@16 | |
1921 // unsigned __int8 v19; // c3@16 | |
1922 double v20; // st6@16 | |
1923 float v21; // ST18_4@17 | |
1924 float v22; // ST2C_4@17 | |
1925 float v23; // ST34_4@17 | |
1926 float v24; // ST24_4@17 | |
1927 double v25; // st7@17 | |
1928 double v26; // st6@17 | |
1929 float v27; // ST34_4@18 | |
1930 float v28; // ST30_4@18 | |
1931 int v29; // eax@19 | |
1932 signed int v31; // [sp+8h] [bp-28h]@15 | |
1933 float v32; // [sp+Ch] [bp-24h]@16 | |
1934 float v33; // [sp+14h] [bp-1Ch]@16 | |
1935 float v34; // [sp+18h] [bp-18h]@16 | |
1936 float v35; // [sp+1Ch] [bp-14h]@17 | |
1937 float v36; // [sp+20h] [bp-10h]@4 | |
1938 float v37; // [sp+24h] [bp-Ch]@4 | |
1939 float v38; // [sp+24h] [bp-Ch]@16 | |
1940 float v39; // [sp+28h] [bp-8h]@9 | |
1941 float v40; // [sp+28h] [bp-8h]@16 | |
1942 float v41; // [sp+2Ch] [bp-4h]@6 | |
1943 float v42; // [sp+2Ch] [bp-4h]@9 | |
1944 | |
1945 //__debugbreak();//нужно почистить, срабатывает при применении закла Точечный взрыв | |
1946 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
1947 { | |
1948 | |
1949 if (this->uNumVertices > 0) | |
1950 { | |
1951 v3 = (int)&this->field_14[1]; | |
1952 //do | |
1953 for (v2 = 0; v2 < this->uNumVertices; ++v2) | |
1954 { | |
1955 v4 = *(float *)(v3 - 4); | |
1956 LODWORD(v37) = *(int *)v3; | |
1957 LODWORD(v36) = *(int *)(v3 + 4); | |
1958 if (pGame->pIndoorCameraD3D->sRotationX) | |
1959 { | |
1960 v5 = v4 - (double)pGame->pIndoorCameraD3D->vPartyPos.x; | |
1961 v6 = v37 - (double)pGame->pIndoorCameraD3D->vPartyPos.y; | |
1962 //if ( pRenderer->pRenderD3D ) | |
1963 //{ | |
1964 v41 = pGame->pIndoorCameraD3D->fRotationYSine * v6 + pGame->pIndoorCameraD3D->fRotationYCosine * v5; | |
1965 v7 = pGame->pIndoorCameraD3D->fRotationYSine * v5 - pGame->pIndoorCameraD3D->fRotationYCosine * v6; | |
1966 /*} | |
1967 else | |
1968 { | |
1969 v41 = pBLVRenderParams->fCosineY * v5 - pBLVRenderParams->fSineY * v6; | |
1970 v7 = pBLVRenderParams->fSineY * v5 + pBLVRenderParams->fCosineY * v6; | |
1971 }*/ | |
1972 v8 = v7; | |
1973 v9 = v36 - (double)pGame->pIndoorCameraD3D->vPartyPos.z; | |
1974 v10 = pGame->pIndoorCameraD3D->fRotationXCosine * v41 - pGame->pIndoorCameraD3D->fRotationXSine * v9; | |
1975 v11 = v8; | |
1976 v12 = pGame->pIndoorCameraD3D->fRotationXCosine * v9 + pGame->pIndoorCameraD3D->fRotationXSine * v41; | |
1977 } | |
1978 else | |
1979 { | |
1980 v42 = v4 - (double)pGame->pIndoorCameraD3D->vPartyPos.x; | |
1981 v39 = v37 - (double)pGame->pIndoorCameraD3D->vPartyPos.y; | |
1982 //if ( pRenderer->pRenderD3D ) | |
1983 //{ | |
1984 v10 = pGame->pIndoorCameraD3D->fRotationYSine * v39 + pGame->pIndoorCameraD3D->fRotationYCosine * v42; | |
1985 v11 = pGame->pIndoorCameraD3D->fRotationYSine * v42 - pGame->pIndoorCameraD3D->fRotationYCosine * v39; | |
1986 /*} | |
1987 else | |
1988 { | |
1989 v10 = pBLVRenderParams->fCosineY * v42 - pBLVRenderParams->fSineY * v39; | |
1990 v11 = pBLVRenderParams->fSineY * v42 + pBLVRenderParams->fCosineY * v39; | |
1991 }*/ | |
1992 v12 = v36 - (double)pGame->pIndoorCameraD3D->vPartyPos.z; | |
1993 } | |
1994 v13 = v12; | |
1995 //++v2; | |
1996 *(int *)(v3 + 84) = LODWORD(v13); | |
1997 v14 = *(int *)(v3 + 8); | |
1998 *(float *)(v3 + 76) = v10; | |
1999 *(int *)(v3 + 88) = v14; | |
2000 *(float *)(v3 + 80) = v11; | |
2001 v3 += 16; | |
2002 } | |
2003 //while ( v2 < this->uNumVertices ); | |
2004 } | |
2005 } | |
2006 else | |
2007 { | |
2008 v15 = (char *)&this->field_14[1]; | |
2009 //do | |
2010 for (v31 = 3; v31; --v31) | |
2011 { | |
2012 v40 = (double)stru_5C6E00->Cos(pGame->pIndoorCameraD3D->sRotationX) * 0.0000152587890625; | |
2013 v32 = (double)stru_5C6E00->Sin(pGame->pIndoorCameraD3D->sRotationX) * 0.0000152587890625; | |
2014 v34 = (double)stru_5C6E00->Cos(pGame->pIndoorCameraD3D->sRotationY) * 0.0000152587890625; | |
2015 v33 = (double)stru_5C6E00->Sin(pGame->pIndoorCameraD3D->sRotationY) * 0.0000152587890625; | |
2016 //v16 = stru_5C6E00->Sin(pODMRenderParams->rotation_y); | |
2017 LODWORD(v38) = *(int *)v15; | |
2018 //UNDEF(v17); | |
2019 v20 = *((float *)v15 - 1) - (double)pGame->pIndoorCameraD3D->vPartyPos.x; | |
2020 //if ( v19 | v18 ) | |
2021 if (pGame->pIndoorCameraD3D->vPartyPos.x == 0) | |
2022 { | |
2023 v27 = v20; | |
2024 LODWORD(v35) = *((int *)v15 + 1); | |
2025 v28 = v38 - (double)pGame->pIndoorCameraD3D->vPartyPos.y; | |
2026 v25 = v33 * v28 + v34 * v27; | |
2027 v26 = v34 * v28 - v33 * v27; | |
2028 } | |
2029 else | |
2030 { | |
2031 v21 = v20; | |
2032 v22 = v38 - (double)pGame->pIndoorCameraD3D->vPartyPos.y; | |
2033 v23 = v33 * v22 + v34 * v21; | |
2034 v24 = *((float *)v15 + 1) - (double)pGame->pIndoorCameraD3D->vPartyPos.z; | |
2035 v25 = v32 * v24 + v40 * v23; | |
2036 v26 = v34 * v22 - v33 * v21; | |
2037 v35 = v40 * v24 - v32 * v23; | |
2038 } | |
2039 *((int *)v15 + 21) = LODWORD(v35); | |
2040 v29 = *((int *)v15 + 2); | |
2041 *((float *)v15 + 19) = v25; | |
2042 *((int *)v15 + 22) = v29; | |
2043 *((float *)v15 + 20) = v26; | |
2044 v15 += 16; | |
2045 //--v31; | |
2046 } | |
2047 //while ( v31 ); | |
2048 } | |
2049 this->uNumVertices = 3; | |
2050 return 1; | |
2051 } | |
2052 | |
2053 //----- (00477F63) -------------------------------------------------------- | |
2054 bool stru6_stru1_indoor_sw_billboard::sub_477F63() | |
2055 { | |
2056 signed int v1; // ebx@1 | |
2057 double v3; // st7@2 | |
2058 //int v4; // edx@4 | |
2059 char *v5; // ecx@5 | |
2060 int v6; // edi@5 | |
2061 float v7; // ST08_4@13 | |
2062 signed int v9; // [sp+Ch] [bp-8h]@1 | |
2063 float v10; // [sp+10h] [bp-4h]@2 | |
2064 | |
2065 //__debugbreak();// почистить | |
2066 v1 = 0; | |
2067 v9 = 0; | |
2068 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
2069 { | |
2070 v10 = 16192.0; | |
2071 v3 = (double)pBLVRenderParams->fov_rad_fixpoint * 0.000015258789; | |
2072 } | |
2073 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
2074 { | |
2075 v10 = (double)pODMRenderParams->shading_dist_mist; | |
2076 v3 = 8.0; | |
2077 } | |
2078 else | |
2079 __debugbreak();//Error | |
2080 if (this->uNumVertices <= 0) | |
2081 { | |
2082 memcpy(&this->field_14[40], &this->field_14[20], 16 * this->uNumVertices); | |
2083 return this->uNumVertices != 0; | |
2084 } | |
2085 v5 = (char *)&this->field_14[20]; | |
2086 for (v6 = 0; v6 < this->uNumVertices; v6++) | |
2087 { | |
2088 if (v3 >= *(float *)v5 || *(float *)v5 >= (double)v10) | |
2089 { | |
2090 if (v3 < *(float *)v5) | |
2091 v9 = 1; | |
2092 else | |
2093 v1 = 1; | |
2094 } | |
2095 v5 += 16; | |
2096 } | |
2097 if (!v1) | |
2098 { | |
2099 if (v9) | |
2100 { | |
2101 this->_477927(v10); | |
2102 return this->uNumVertices != 0; | |
2103 } | |
2104 memcpy(&this->field_14[40], &this->field_14[20], 16 * this->uNumVertices); | |
2105 return this->uNumVertices != 0; | |
2106 } | |
2107 v7 = v3; | |
2108 _4775ED(v7); | |
2109 return this->uNumVertices != 0; | |
2110 } | |
2111 | |
2112 //----- (0047802A) -------------------------------------------------------- | |
2113 int stru6_stru1_indoor_sw_billboard::sub_47802A() | |
2114 { | |
2115 double v6; // st7@4 | |
2116 signed int v16; // [sp+38h] [bp-Ch]@1 | |
2117 int a6; // [sp+3Ch] [bp-8h]@5 | |
2118 int a5; // [sp+40h] [bp-4h]@5 | |
2119 | |
2120 // __debugbreak(); //необходимо проверить this->field_B4[i*4+16] | |
2121 v16 = 0; | |
2122 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
2123 { | |
2124 for (int i = 0; i < this->uNumVertices; i++) | |
2125 { | |
2126 v6 = (double)pBLVRenderParams->fov_rad_fixpoint * 0.000015258789 / this->field_B4[i * 4]; | |
2127 //if ( pRenderer->pRenderD3D ) | |
2128 { | |
2129 pGame->pIndoorCameraD3D->Project(round_to_int(this->field_B4[i * 4]), round_to_int(this->field_B4[i * 4 + 1]), round_to_int(this->field_B4[i * 4 + 2]), | |
2130 &a5, &a6); | |
2131 this->field_B4[i * 4 + 16] = (double)a5; | |
2132 this->field_B4[i * 4 + 17] = (double)a6; | |
2133 this->field_B4[i * 4 + 18] = round_to_int(this->field_B4[i * 4]); | |
2134 } | |
2135 /*else | |
2136 { | |
2137 this->field_B4[i*4+16] = (double)pBLVRenderParams->uViewportCenterX - v6 * this->field_B4[i*4+1]; | |
2138 this->field_B4[i*4+17] = (double)pBLVRenderParams->uViewportCenterY - v6 * this->field_B4[i*4+2]; | |
2139 this->field_B4[i*4+18] = this->field_B4[i*4]; | |
2140 }*/ | |
2141 this->field_B4[i * 4 + 19] = this->field_B4[i * 4 + 3]; | |
2142 if ((double)(signed int)pViewport->uViewportTL_X <= this->field_B4[i * 4 + 16] && (double)(signed int)pViewport->uViewportBR_X > this->field_B4[i * 4 + 16] | |
2143 && (double)(signed int)pViewport->uViewportTL_Y <= this->field_B4[i * 4 + 17] && (double)(signed int)pViewport->uViewportBR_Y > this->field_B4[i * 4 + 17]) | |
2144 v16 = 1; | |
2145 } | |
2146 } | |
2147 else | |
2148 { | |
2149 for (int i = 0; i < this->uNumVertices; i++) | |
2150 { | |
2151 this->field_B4[i * 4 + 20] = (double)pViewport->uScreenCenterX - (double)pODMRenderParams->int_fov_rad / this->field_B4[i * 4] * this->field_B4[i * 4 + 1]; | |
2152 this->field_B4[i * 4 + 21] = (double)pViewport->uScreenCenterY - (double)pODMRenderParams->int_fov_rad / this->field_B4[i * 4] * this->field_B4[i * 4 + 2]; | |
2153 *((int *)&this->field_B4[i * 4 + 22]) = (int)this->field_B4[i * 4]; | |
2154 *((int *)&this->field_B4[i * 4 + 23]) = this->field_B4[i * 4 + 3]; | |
2155 if ((double)(signed int)pViewport->uViewportTL_X <= this->field_B4[i * 4 + 20] && (double)(signed int)pViewport->uViewportBR_X > this->field_B4[i * 4 + 20] | |
2156 && (double)(signed int)pViewport->uViewportTL_Y <= this->field_B4[i * 4 + 21] && (double)(signed int)pViewport->uViewportBR_Y > this->field_B4[i * 4 + 21]) | |
2157 v16 = 1; | |
2158 } | |
2159 } | |
2160 return v16; | |
2161 } |