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