comparison Engine/stru6.cpp @ 2567:d569340b05ff

Few constants changed into enum values
author a.parshin
date Thu, 21 May 2015 01:50:59 +0200
parents
children a76d408c5132
comparison
equal deleted inserted replaced
2566:30eb6dcac768 2567:d569340b05ff
1 #define _CRTDBG_MAP_ALLOC
2 #include <stdlib.h>
3 #include <crtdbg.h>
4
5 #define _CRT_SECURE_NO_WARNINGS
6
7 #include "Engine/Engine.h"
8
9 #include "stru6.h"
10
11 #include "Engine/Graphics/LightmapBuilder.h"
12 #include "Engine/Objects/SpriteObject.h"
13 #include "Engine/Graphics/ParticleEngine.h"
14 #include "Engine/LOD.h"
15 #include "Engine/Graphics/Sprites.h"
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"
21 #include "Engine/Graphics/Viewport.h"
22 #include "Engine/Graphics/Overlays.h"
23 #include "Engine/stru160.h"
24 #include "Engine/OurMath.h"
25 #include "Engine/Graphics/Lights.h"
26 #include "Engine/Graphics/Indoor.h"
27
28
29
30
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
54 //----- (0042620A) --------------------------------------------------------
55 bool sr_42620A(RenderVertexSoft *p)
56 {
57 // __int16 v1; // fps@1
58 unsigned __int8 v2; // c0@2
59 char v3; // c2@2
60 unsigned __int8 v4; // c3@2
61 // bool result; // eax@2
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
128 //----- (004775C4) --------------------------------------------------------
129 stru6_stru1_indoor_sw_billboard::~stru6_stru1_indoor_sw_billboard()
130 {
131 delete [] pArray1;
132 pArray1 = nullptr;
133
134 delete [] pArray2;
135 pArray2 = nullptr;
136 }
137
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 }
155 memcpy(pArray2, array_4EBBD0_x.data()/*array_4EBBD0*/, uNumVec3sInArray2 * sizeof(stru160));
156 }
157
158 //----- (0047829F) --------------------------------------------------------
159 void stru6_stru1_indoor_sw_billboard::_47829F_sphere_particle(float x_offset, float y_offset, float z_offset, float scale, int diffuse)
160 {
161 int v7 = 0;
162
163 for (unsigned int i = 0; i < uNumVec3sInArray2; ++i)
164 {
165 for (unsigned int j = 0; j < 3; ++j)
166 {
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));
170 //int v10 = *(int *)((char *)&pArray2->field_0 + v7);
171
172 field_14[j].diffuse = *((int *)&pArray1[1].field_0 + 4 * (*(int *)((char *)&pArray2->field_0 + v7)));
173 v7 += 4;
174 }
175
176 uNumVertices = 3;
177 if ( sub_477C61() && sub_477F63() )
178 {
179 if ( sub_47802A() )
180 pRenderer->_4A4CC9_AddSomeBillboard(this, diffuse);
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 {
191 //int v8; // eax@1
192
193 //v8 = uNumProjectiles;
194 if (uNumProjectiles < 32)
195 {
196 pProjectiles[uNumProjectiles].srcX = srcX;
197 pProjectiles[uNumProjectiles].srcY = srcY;
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 {
216 ProjectileAnim* p = &pProjectiles[i];
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;
224 pIndoorCameraD3D->ViewTransform(v, 2);
225
226 sr_42620A(v);
227
228 pIndoorCameraD3D->Project(v, 2, 0);
229
230 if (p->uTextureID != -1)
231 v12 = pBitmaps_LOD->pHardwareTextures[p->uTextureID];
232 else
233 v12 = 0;
234
235 v10 = pIndoorCameraD3D->fov_x / v[1].vWorldViewPosition.x * 20.0;
236 v11 = pIndoorCameraD3D->fov_x / v[0].vWorldViewPosition.x * 20.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) --------------------------------------------------------
251 void stru6::_4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(SpriteObject *a2, unsigned int uDiffuse, unsigned int uTextureID)
252 {
253 stru6 *v4; // edi@1
254 SpriteObject *v5; // esi@1
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
260 Particle_sw local_0; // [sp+8h] [bp-68h]@1
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 {
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;
273 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8;
274 local_0.uDiffuse = uDiffuse;
275 local_0.x = x + 4.0;
276 local_0.y = v8;
277 local_0.z = v9;
278 local_0.r = 0.0;
279 local_0.g = 0.0;
280 local_0.b = 0.0;
281 local_0.timeToLive = (rand() & 0x40) + 96;
282 local_0.uTextureID = uTextureID;
283 local_0.flt_28 = 1.0;
284 pEngine->pParticleEngine->AddParticle(&local_0);
285 local_0.x = x - 4.0;
286 pEngine->pParticleEngine->AddParticle(&local_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;
290 pEngine->pParticleEngine->AddParticle(&local_0);
291 local_0.x = (double)v5->vPosition.x - 4.0;
292 pEngine->pParticleEngine->AddParticle(&local_0);
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;
296 }
297 else
298 {
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;
303 v10 = (double)a2->vPosition.x;
304 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8;
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;
309 local_0.r = 0.0;
310 local_0.g = 0.0;
311 local_0.b = 0.0;
312 local_0.flt_28 = 1.0;
313 local_0.timeToLive = (rand() & 0x7F) + 128;
314 local_0.uTextureID = uTextureID;
315 pEngine->pParticleEngine->AddParticle(&local_0);
316 local_0.x = (double)a2->vPosition.x - 4.0;
317 pEngine->pParticleEngine->AddParticle(&local_0);
318 }
319 }
320
321 //----- (004A75CC) --------------------------------------------------------
322 void stru6::_4A75CC_single_spell_collision_particle(SpriteObject *a1, unsigned int uDiffuse, unsigned int uTextureID)
323 {
324 double v4; // st7@1
325 signed int v5; // edi@1
326 Particle_sw local_0; // [sp+8h] [bp-68h]@1
327
328 memset(&local_0, 0, 0x68u);
329 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_1;
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 {
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;
344 pEngine->pParticleEngine->AddParticle(&local_0);
345 --v5;
346 }
347 while ( v5 );
348 }
349
350 //----- (004A7688) --------------------------------------------------------
351 void stru6::_4A7688_fireball_collision_particle(SpriteObject *a2)
352 {
353 double v3; // st7@1
354 double v4; // st7@2
355 Particle_sw local_0; // [sp+1Ch] [bp-7Ch]@1
356
357 memset(&local_0, 0, 0x68u);
358
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;
364
365 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_1;
366 local_0.uDiffuse = 0xFF3C1E;
367 local_0.x = (double)a2->vPosition.x;
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;
373
374 // 10 fireball sparks
375 for (unsigned int i = 0; i < 10; ++i)
376 {
377 local_0.r = (rand() & 0x1FF) - 255;
378 local_0.g = (rand() & 0x1FF) - 255;
379 local_0.b = (rand() & 0x1FF) - 255;
380 pEngine->pParticleEngine->AddParticle(&local_0);
381 }
382
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));
385 }
386
387 //----- (004A77FD) --------------------------------------------------------
388 void stru6::_4A77FD_implosion_particle_d3d(SpriteObject *a1)
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;
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);
412 }
413
414 //----- (004A78AE) --------------------------------------------------------
415 void stru6::_4A78AE_sparks_spell(SpriteObject *a1)
416 {
417 ObjectDesc *v2; // esi@1
418 unsigned int v3; // eax@1
419 double v4; // st7@1
420 Particle_sw local_0; // [sp+8h] [bp-68h]@1
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;
427 local_0.type = ParticleType_Sprite;
428 local_0.uDiffuse = 0x7F7F7F;
429 local_0.timeToLive = 1;
430 local_0.y = v4;
431 local_0.z = (double)a1->vPosition.z;
432 local_0.r = 0.0;
433 local_0.g = 0.0;
434 local_0.b = 0.0;
435 local_0.uTextureID = pSpriteFrameTable->GetFrame(v2->uSpriteID, v3)->pHwSpriteIDs[0];
436 LODWORD(local_0.flt_28) = 0x40000000u;
437 pEngine->pParticleEngine->AddParticle(&local_0);
438 }
439
440 //----- (004A7948) --------------------------------------------------------
441 void stru6::_4A7948_mind_blast_after_effect(SpriteObject *a1)
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
448 Particle_sw Dst; // [sp+8h] [bp-68h]@1
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;
455 Dst.type = ParticleType_Sprite | ParticleType_Rotating | ParticleType_1;
456 Dst.uDiffuse = 0x7F7F7F;
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 {
466 Dst.r = (double)(rand() & 0x1FF) - 255.0;
467 Dst.g = (double)(rand() & 0x1FF) - 255.0;
468 Dst.b = (double)(rand() & 0x1FF) - 255.0;
469 pEngine->pParticleEngine->AddParticle(&Dst);
470 --v6;
471 }
472 while ( v6 );
473 }
474
475 //----- (004A7A27) --------------------------------------------------------
476 bool stru6::AddMobileLight(SpriteObject *a1, unsigned int uDiffuse, int uRadius)
477 {
478 return pMobileLightsStack->AddLight(a1->vPosition.x, a1->vPosition.y, a1->vPosition.z, a1->uSectorID, uRadius,
479 (uDiffuse & 0x00FF0000) >> 16,
480 (uDiffuse & 0x0000FF00) >> 8,
481 uDiffuse & 0x000000FF,
482 _4E94D3_light_type);
483 }
484 // 4E94D3: using guessed type char _4E94D3_light_type;
485
486 //----- (004A7A66) --------------------------------------------------------
487 void stru6::_4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(SpriteObject *a1, unsigned int uDiffuse, unsigned int uTextureID, float a4)
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
495 Particle_sw local_0; // [sp+0h] [bp-6Ch]@1
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);
502 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_1;
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;
514 local_0.r = v7;
515 local_0.g = a4;
516 local_0.b = a4;
517 pEngine->pParticleEngine->AddParticle(&local_0);
518 v8 = 0.70710677 * a4;
519 uDiffusea = v8;
520 local_0.r = v8;
521 local_0.g = v8;
522 local_0.b = a4;
523 pEngine->pParticleEngine->AddParticle(&local_0);
524 local_0.g = a1a;
525 local_0.r = a4;
526 local_0.b = a4;
527 pEngine->pParticleEngine->AddParticle(&local_0);
528 local_0.r = uDiffusea;
529 local_0.b = a4;
530 v9 = -uDiffusea;
531 uTextureIDa = v9;
532 local_0.g = v9;
533 pEngine->pParticleEngine->AddParticle(&local_0);
534 v10 = -1.0 * a4;
535 local_0.r = a1a;
536 v12 = v10;
537 local_0.g = v10;
538 local_0.b = a4;
539 pEngine->pParticleEngine->AddParticle(&local_0);
540 local_0.b = a4;
541 local_0.r = uTextureIDa;
542 local_0.g = uTextureIDa;
543 pEngine->pParticleEngine->AddParticle(&local_0);
544 local_0.r = v12;
545 local_0.g = a1a;
546 local_0.b = a4;
547 pEngine->pParticleEngine->AddParticle(&local_0);
548 local_0.r = uTextureIDa;
549 local_0.g = uDiffusea;
550 local_0.b = a4;
551 pEngine->pParticleEngine->AddParticle(&local_0);
552 }
553
554 //----- (004A7C07) --------------------------------------------------------
555 void stru6::_4A7C07_stun_spell_fx(SpriteObject *a2)
556 {
557 stru6 *v2; // edi@1
558 SpriteObject *v3; // esi@1
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
568 Particle_sw local_0; // [sp+Ch] [bp-68h]@1
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 {
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;
582 local_0.type = ParticleType_Sprite;
583 local_0.uDiffuse = 0xFFFFFF;
584 a2a = v9;
585 local_0.x = v7;
586 local_0.z = a2a;
587 local_0.y = v8;
588 local_0.r = 0.0;
589 local_0.g = 0.0;
590 local_0.b = 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];
595 pEngine->pParticleEngine->AddParticle(&local_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;
602 pEngine->pParticleEngine->AddParticle(&local_0);
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;
606 }
607 else
608 {
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;
613 v12 = (double)a2->vPosition.x;
614 local_0.type = ParticleType_Sprite;
615 local_0.uDiffuse = 0xFFFFFF;
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;
620 local_0.r = 0.0;
621 local_0.g = 0.0;
622 local_0.b = 0.0;
623 local_0.timeToLive = (rand() & 0x3F) + 64;
624 local_0.uTextureID = pSpriteFrameTable->GetFrame(v5->uSpriteID, a2->uSpriteFrameID)->pHwSpriteIDs[0];
625 pEngine->pParticleEngine->AddParticle(&local_0);
626 }
627 }
628
629 //----- (004A7E05) --------------------------------------------------------
630 void stru6::AddProjectile(SpriteObject *a2, int a3, unsigned int uTextureID)
631 {
632 if (a2->field_54)
633 {
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);
641 }
642 else
643 {
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;
648 }
649 }
650
651 //----- (004A7E89) --------------------------------------------------------
652 void stru6::_4A7E89_sparkles_on_actor_after_it_casts_buff(Actor *pActor, unsigned int uDiffuse)
653 {
654 Actor *v3; // edi@1
655 int v4; // ebx@3
656 //int result; // eax@5
657 Particle_sw Dst; // [sp+Ch] [bp-6Ch]@1
658 int v7; // [sp+74h] [bp-4h]@2
659 signed int pActora; // [sp+80h] [bp+8h]@1
660
661 memset(&Dst, 0, 0x68u);
662 Dst.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8;
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 }
685 pEngine->pParticleEngine->AddParticle(&Dst);
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
700 Particle_sw local_0; // [sp+8h] [bp-78h]@1
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);
707 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_1;
708 local_0.uDiffuse = 0x7E7E7E;
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;
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;
728 pEngine->pParticleEngine->AddParticle(&local_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;
743 v3 = LODWORD(pActor->pActorBuffs[ACTOR_BUFF_MASS_DISTORTION].uExpireTime) - pMiscTimer->uTotalGameTimeElapsed;
744 if ( (signed int)v3 <= 64 )
745 {
746 if ( (v3 & 0x80000000u) != 0 )
747 {
748 pActor->pActorBuffs[ACTOR_BUFF_MASS_DISTORTION].uExpireTime = 0i64;
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;
763 return fixpoint_from_float(v5);
764 }
765
766 //----- (004A81CA) --------------------------------------------------------
767 bool stru6::RenderAsSprite(SpriteObject *a2)
768 {
769 //stru6 *v2; // ebx@1
770 int result; // eax@1
771 // int v4; // eax@27
772 //unsigned int diffuse; // esi@41
773 //int v6; // ecx@49
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
788 char pContainer[7]; // [sp+10h] [bp-8h]@81
789
790 //__debugbreak(); // need to refactor carefully & collect data
791 //v2 = this;
792 result = a2->uType;
793
794 switch (a2->uType)
795 {
796
797 case SPRITE_PROJECTILE_500:
798 case SPRITE_PROJECTILE_530:
799 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x00AAAFF, uTextureID_effpar1);
800 return false;
801 case SPRITE_PROJECTILE_500_IMPACT:
802 case SPRITE_PROJECTILE_530_IMPACT:
803 _4A75CC_single_spell_collision_particle(a2, 0xAAAFF, uTextureID_effpar1);
804 return true;
805
806 case SPRITE_PROJECTILE_505:
807 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x5C310E, uTextureID_effpar1);
808 return false;
809 case SPRITE_PROJECTILE_505_IMPACT:
810 _4A75CC_single_spell_collision_particle(a2, 0x5C310E, uTextureID_effpar1);
811 return false;
812
813 case SPRITE_PROJECTILE_510:
814 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xFF3C1E, uTextureID_effpar1);
815 return false;
816 case SPRITE_PROJECTILE_510_IMPACT:
817 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1E, uTextureID_effpar1);
818 return false;
819
820 case SPRITE_PROJECTILE_515:
821 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x0062D0, uTextureID_effpar1);
822 return false;
823 case SPRITE_PROJECTILE_515_IMPACT:
824 _4A75CC_single_spell_collision_particle(a2, 0x0062D0, uTextureID_effpar1);
825 return false;
826
827 case SPRITE_PROJECTILE_520:
828 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x0AB450, uTextureID_effpar1);
829 return false;
830 case SPRITE_PROJECTILE_520_IMPACT:
831 _4A75CC_single_spell_collision_particle(a2, 0x0AB450, uTextureID_effpar1);
832 return false;
833
834 case SPRITE_PROJECTILE_525:
835 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xC8C805, uTextureID_effpar1);
836 return false;
837 case SPRITE_PROJECTILE_525_IMPACT:
838 _4A75CC_single_spell_collision_particle(a2, 0xC8C805, uTextureID_effpar1);
839 return false;
840
841 case SPRITE_PROJECTILE_535:
842 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xFFFFFF, uTextureID_effpar1);
843 return false;
844 case SPRITE_PROJECTILE_535_IMPACT:
845 _4A75CC_single_spell_collision_particle(a2, 0xFFFFFF, uTextureID_effpar1);
846 return false;
847
848 case SPRITE_PROJECTILE_540:
849 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x7E7E7E, uTextureID_effpar1);
850 return false;
851 case SPRITE_PROJECTILE_540_IMPACT:
852 _4A75CC_single_spell_collision_particle(a2, 0x7E7E7E, uTextureID_effpar1);
853 return false;
854
855 case SPRITE_PROJECTILE_545:
856 case SPRITE_PROJECTILE_550:
857 case SPRITE_PROJECTILE_555:
858 return true;
859
860
861 case SPRITE_556: __debugbreak();//what kind of effect is this?
862 AddMobileLight(a2, 0xFF0000, 256);
863 return false;
864
865 case SPRITE_600: __debugbreak();//what kind of effect is this?
866 AddMobileLight(a2, 0xFF3C1E, 256);
867 return true;
868
869 case 546: case 547: case 548: case 549:
870 case 551: case 552: case 553: case 554: case 557: case 558: case 559:
871 case 560: case 561: case 562: case 563: case 564: case 565: case 566: case 567: case 568: case 569:
872 case 570: case 571: case 572: case 573: case 574: case 575: case 576: case 577: case 578: case 579:
873 case 580: case 581: case 582: case 583: case 584: case 585: case 586: case 587: case 588: case 589:
874 case 590: case 591: case 592: case 593: case 594: case 595: case 596: case 597: case 598: case 599:
875 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1E, uTextureID_effpar1);
876 return false;
877
878 case SPRITE_811:
879 case SPRITE_812:
880 case SPRITE_813:
881 case SPRITE_814:
882 return true;
883
884
885 case SPRITE_SPELL_FIRE_FIRE_BOLT:
886 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xFF3C1E, uTextureID_effpar1);
887 AddMobileLight(a2, 0xFF3C1E, 256);
888 return false;
889
890 case SPRITE_SPELL_FIRE_FIRE_BOLT_IMPACT:
891 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1E, uTextureID_effpar1);
892 AddMobileLight(a2, 0xFF3C1E, 256);
893 return false;
894
895
896
897 case SPRITE_SPELL_FIRE_FIREBALL:
898 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xFF3C1E, uTextureID_effpar1);
899 AddMobileLight(a2, 0xFF3C1E, 256);
900 return false;
901
902 case SPRITE_SPELL_FIRE_FIREBALL_IMPACT:
903 AddMobileLight(a2, 0xFF3C1E, 256);
904 //if (pRenderer->pRenderD3D)
905 {
906 if (PID_TYPE(a2->spell_caster_pid) != OBJECT_Actor &&
907 PID_TYPE(a2->spell_caster_pid) != OBJECT_Item)
908 {
909 if (field_204 != 4)
910 {
911 field_204++;
912 _4A7688_fireball_collision_particle(a2);
913 }
914 return false;
915 }
916 }
917 return true;
918
919
920 case SPRITE_SPELL_FIRE_FIRE_SPIKE:
921 return true;
922 case SPRITE_SPELL_FIRE_FIRE_SPIKE_IMPACT:
923 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xFF3C1E, uTextureID_effpar1, 250.0);
924 AddMobileLight(a2, 0xFF3C1E, 256);
925 return false;
926
927 case SPRITE_SPELL_FIRE_IMMOLATION:
928 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1E, uTextureID_effpar1);
929 return false;
930
931 case SPRITE_SPELL_FIRE_METEOR_SHOWER:
932 return true;
933 case SPRITE_SPELL_FIRE_METEOR_SHOWER_1:
934 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xFF3C1E, uTextureID_effpar1, 300.0);
935 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xFF3C1E, uTextureID_effpar1, 250.0);
936 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xFF3C1E, uTextureID_effpar1, 200.0);
937 AddMobileLight(a2, 0xFF3C1E, 256);
938 return false;
939
940 case SPRITE_SPELL_FIRE_INFERNO:
941 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xFF3C1Eu, uTextureID_effpar1, 250.0);
942 return false;
943
944 case SPRITE_SPELL_FIRE_INCINERATE:
945 return true;
946 case SPRITE_SPELL_FIRE_INCINERATE_IMPACT:
947 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1E, uTextureID_effpar1);
948 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1E, uTextureID_effpar1);
949 AddMobileLight(a2, 0xFF3C1E, 256);
950 return false;
951
952
953
954 case SPRITE_SPELL_AIR_SPARKS:
955 //if ( !pRenderer->pRenderD3D )
956 // return true;
957 _4A78AE_sparks_spell(a2);
958 AddMobileLight(a2, 0x64640F, 128);
959 return false;
960
961 case SPRITE_SPELL_AIR_LIGHNING_BOLT:
962 //if ( !pRenderer->pRenderD3D )
963 // return true;
964 memcpy(pContainer, "sp18h1", 7);
965 pRnd->SetRange(1, 6);
966 pContainer[5] = pRnd->GetInRange() + '0';
967 AddProjectile(a2, 100, pBitmaps_LOD->LoadTexture(pContainer));
968 return false;
969 case SPRITE_SPELL_AIR_LIGHNING_BOLT_IMPACT:
970 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xC8C814, uTextureID_effpar2, 200.0);
971 AddMobileLight(a2, 0xC8C814, 256);
972 return false;
973
974 case SPRITE_SPELL_AIR_IMPLOSION:
975 case SPRITE_SPELL_AIR_IMPLOSION_IMPACT:
976 //if ( pRenderer->pRenderD3D )
977 _4A77FD_implosion_particle_d3d(a2);
978 /*else
979 _4A80DC_implosion_particle_sw(a2);*/
980 return false;
981
982 case SPRITE_SPELL_AIR_STARBURST:
983 return true;
984 case SPRITE_SPELL_AIR_STARBURST_1:
985 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xC8C814, uTextureID_effpar1, 200.0);
986 AddMobileLight(a2, 0xC8C814, 256);
987 return false;
988
989
990
991 case SPRITE_SPELL_WATER_POISON_SPRAY:
992 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xAB450, uTextureID_effpar1);
993 AddMobileLight(a2, 0xAB450, 256);
994 return false;
995 case SPRITE_SPELL_WATER_POISON_SPRAY_IMPACT:
996 _4A75CC_single_spell_collision_particle(a2, 0xAB450, uTextureID_effpar1);
997 AddMobileLight(a2, 0xAB450, 256);
998 return false;
999
1000 case SPRITE_SPELL_WATER_ICE_BOLT:
1001 return true;
1002 case SPRITE_SPELL_WATER_ICE_BOLT_IMPACT:
1003 _4A75CC_single_spell_collision_particle(a2, 0x9EB9F1, uTextureID_effpar1);
1004 AddMobileLight(a2, 0x9EB9F1, 256);
1005 return false;
1006
1007 case SPRITE_SPELL_WATER_ACID_BURST:
1008 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x0AB450, uTextureID_effpar1);
1009 AddMobileLight(a2, 0x0AB450, 256);
1010 return false;
1011 case SPRITE_SPELL_WATER_ACID_BURST_IMPACT:
1012 return true;
1013
1014 case SPRITE_SPELL_WATER_ICE_BLAST:
1015 return true;
1016 case SPRITE_SPELL_WATER_ICE_BLAST_IMPACT:
1017 _4A75CC_single_spell_collision_particle(a2, 0x9EB9F1, uTextureID_effpar1);
1018 AddMobileLight(a2, 0x9EB9F1, 256);
1019 return false;
1020 case SPRITE_SPELL_WATER_ICE_BLAST_FALLOUT:
1021 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x9EB9F1, uTextureID_effpar1);
1022 return false;
1023
1024
1025 case SPRITE_SPELL_EARTH_STUN:
1026 //if ( !pRenderer->pRenderD3D )
1027 // return true;
1028 _4A7C07_stun_spell_fx(a2);
1029 return false;
1030
1031 case SPRITE_SPELL_EARTH_DEADLY_SWARM:
1032 case SPRITE_SPELL_EARTH_DEADLY_SWARM_IMPACT:
1033 return true;
1034
1035 case SPRITE_SPELL_EARTH_ROCK_BLAST:
1036 return true;
1037 case SPRITE_SPELL_EARTH_ROCK_BLAST_IMPACT:
1038 _4A75CC_single_spell_collision_particle(a2, 0x5C310E, uTextureID_effpar1);
1039 return false;
1040
1041 case SPRITE_SPELL_EARTH_TELEKINESIS:
1042 return true;
1043
1044 case SPRITE_SPELL_EARTH_BLADES:
1045 return true;
1046 case SPRITE_SPELL_EARTH_BLADES_IMPACT:
1047 _4A7948_mind_blast_after_effect(a2);
1048 return false;
1049
1050 case SPRITE_SPELL_EARTH_DEATH_BLOSSOM:
1051 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x7E7E7E, uTextureID_effpar1);
1052 return true;
1053 case SPRITE_SPELL_EARTH_DEATH_BLOSSOM_IMPACT:
1054 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0x7E7E7E, uTextureID_effpar1, 200.0);
1055 return false;
1056 case SPRITE_SPELL_EARTH_DEATH_BLOSSOM_FALLOUT:
1057 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x7E7E7E, uTextureID_effpar1);
1058 return false;
1059
1060 case SPRITE_SPELL_EARTH_MASS_DISTORTION:
1061 return false;
1062
1063 case SPRITE_SPELL_MIND_MIND_BLAST:
1064 case SPRITE_SPELL_MIND_TELEPATHY:
1065 case SPRITE_SPELL_MIND_BERSERK:
1066 case SPRITE_SPELL_MIND_CHARM:
1067 case SPRITE_SPELL_MIND_MASS_FEAR:
1068 case SPRITE_SPELL_MIND_ENSLAVE:
1069 case SPRITE_SPELL_MIND_PSYCHIC_SHOCK:
1070 return true;
1071
1072 case SPRITE_SPELL_MIND_MIND_BLAST_IMPACT:
1073 _4A7948_mind_blast_after_effect(a2);
1074 return false;
1075
1076
1077
1078 case SPRITE_SPELL_BODY_HARM:
1079 //if ( !pRenderer->pRenderD3D )
1080 // return true;
1081 _4A78AE_sparks_spell(a2);
1082 AddMobileLight(a2, 0x64640F, 128);
1083 return false;
1084 case SPRITE_SPELL_BODY_HARM_IMPACT:
1085 _4A75CC_single_spell_collision_particle(a2, 0xF00000, uTextureID_effpar1);
1086 return false;
1087
1088 case SPRITE_SPELL_BODY_FLYING_FIST:
1089 return true;
1090 case SPRITE_SPELL_BODY_FLYING_FIST_IMPACT:
1091 _4A75CC_single_spell_collision_particle(a2, 0xF00000, uTextureID_effpar1);
1092 AddMobileLight(a2, 0xF00000, 256);
1093 return false;
1094
1095
1096
1097 case SPRITE_SPELL_LIGHT_LIGHT_BOLT:
1098 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xFFFFFF, uTextureID_effpar3);
1099 AddMobileLight(a2, 0xFFFFFF, 128);
1100 return false;
1101 case SPRITE_SPELL_LIGHT_LIGHT_BOLT_IMPACT:
1102 _4A75CC_single_spell_collision_particle(a2, 0xFFFFFF, uTextureID_effpar2);
1103 AddMobileLight(a2, 0xFFFFFF, 256);
1104 return false;
1105
1106 case SPRITE_SPELL_LIGHT_DESTROY_UNDEAD:
1107 AddMobileLight(a2, 0xFFFFFF, 64);
1108 return false;
1109
1110 case SPRITE_SPELL_LIGHT_PARALYZE:
1111 return true;
1112
1113 case SPRITE_SPELL_LIGHT_SUMMON_ELEMENTAL:
1114 case SPRITE_SPELL_LIGHT_PRISMATIC_LIGHT:
1115 return true;
1116
1117 case SPRITE_SPELL_LIGHT_SUNRAY:
1118 AddMobileLight(a2, 0xFFFFFFu, 128);
1119 //if ( !pRenderer->pRenderD3D )
1120 // return true;
1121 AddProjectile(a2, 100, -1);
1122 return false;
1123 case SPRITE_SPELL_LIGHT_SUNRAY_IMPACT:
1124 _4A75CC_single_spell_collision_particle(a2, 0xFFFFFF, uTextureID_effpar3);
1125 return false;
1126
1127
1128 case SPRITE_SPELL_DARK_REANIMATE:
1129 return true;
1130
1131 case SPRITE_SPELL_DARK_TOXIC_CLOUD:
1132 case SPRITE_SPELL_DARK_SHRINKING_RAY:
1133 case SPRITE_SPELL_DARK_CONTROL_UNDEAD:
1134 return true;
1135
1136 case SPRITE_SPELL_DARK_SHARPMETAL:
1137 return true;
1138 case SPRITE_SPELL_DARK_SHARPMETAL_IMPACT:
1139 _4A75CC_single_spell_collision_particle(a2, 0x7E7E7E, uTextureID_effpar1);
1140 return false;
1141
1142 case SPRITE_SPELL_DARK_SACRIFICE:
1143 case SPRITE_SPELL_DARK_DRAGON_BREATH:
1144 case SPRITE_SPELL_DARK_DRAGON_BREATH_1:
1145 return true;
1146 }
1147
1148 return false;
1149 }
1150
1151 //----- (004A89BD) --------------------------------------------------------
1152 void stru6::SetPlayerBuffAnim(unsigned __int16 uSpellID, unsigned __int16 uPlayerID)
1153 {
1154 //stru6 *v3; // edi@1
1155 PlayerBuffAnim *v4; // esi@1
1156 const char *v6; // [sp-4h] [bp-10h]@2
1157
1158 v4 = &pPlayerBuffs[uPlayerID];
1159 v4->uSpellAnimTimeElapsed = 0;
1160 v4->bRender = uSpellID != 0;
1161
1162 switch (uSpellID)
1163 {
1164 case SPELL_DISEASE:
1165 v6 = "zapp";
1166 break;
1167
1168 case BECOME_MAGIC_GUILD_MEMBER:
1169 case SPELL_AIR_FEATHER_FALL:
1170 case SPELL_SPIRIT_DETECT_LIFE:
1171 case SPELL_SPIRIT_FATE:
1172 v6 = "spboost1";
1173 break;
1174
1175 case SPELL_QUEST_COMPLETED:
1176 case SPELL_AIR_INVISIBILITY:
1177 case SPELL_WATER_WATER_WALK:
1178 case SPELL_SPIRIT_PRESERVATION:
1179 v6 = "spboost2";
1180 break;
1181
1182 case SPELL_152:
1183 __debugbreak(); // spell id == 152 wtf
1184 case SPELL_LIGHT_HOUR_OF_POWER:
1185 case SPELL_LIGHT_DAY_OF_THE_GODS:
1186 case SPELL_LIGHT_DAY_OF_PROTECTION:
1187 case SPELL_LIGHT_DIVINE_INTERVENTION:
1188 v6 = "spboost3";
1189 break;
1190
1191 case SPELL_SPIRIT_REMOVE_CURSE:
1192 case SPELL_MIND_REMOVE_FEAR:
1193 case SPELL_BODY_CURE_WEAKNESS:
1194 v6 = "spheal1";
1195 break;
1196
1197 case SPELL_SPIRIT_SHARED_LIFE:
1198 case SPELL_MIND_CURE_PARALYSIS:
1199 case SPELL_MIND_CURE_INSANITY:
1200 case SPELL_BODY_FIRST_AID:
1201 case SPELL_BODY_CURE_POISON:
1202 case SPELL_BODY_CURE_DISEASE:
1203 case SPELL_DARK_SACRIFICE:
1204 v6 = "spheal2";
1205 break;
1206
1207 case SPELL_BODY_POWER_CURE:
1208 case SPELL_DARK_SOULDRINKER:
1209 v6 = "spheal3";
1210 break;
1211
1212 case SPELL_FIRE_PROTECTION_FROM_FIRE:
1213 case SPELL_FIRE_IMMOLATION:
1214 v6 = "spell03";
1215 break;
1216
1217 case SPELL_FIRE_HASTE: v6 = "spell05"; break;
1218 case SPELL_AIR_PROTECTION_FROM_AIR: v6 = "spell14"; break;
1219 case SPELL_AIR_SHIELD: v6 = "spell17"; break;
1220 case SPELL_WATER_PROTECTION_FROM_WATER: v6 = "spell25"; break;
1221 case SPELL_EARTH_PROTECTION_FROM_EARTH: v6 = "spell36"; break;
1222 case SPELL_EARTH_STONESKIN: v6 = "spell38"; break;
1223 case SPELL_SPIRIT_BLESS: v6 = "spell46"; break;
1224 case SPELL_SPIRIT_HEROISM: v6 = "spell51"; break;
1225 case SPELL_SPIRIT_RESSURECTION: v6 = "spell55"; break;
1226 case SPELL_MIND_PROTECTION_FROM_MIND: v6 = "spell58"; break;
1227 case SPELL_BODY_PROTECTION_FROM_BODY: v6 = "spell69"; break;
1228 case SPELL_BODY_REGENERATION: v6 = "spell71"; break;
1229 case SPELL_BODY_HAMMERHANDS: v6 = "spell73"; break;
1230 case SPELL_BODY_PROTECTION_FROM_MAGIC: v6 = "spell75"; break;
1231
1232 default:
1233 v4->bRender = false;
1234 return;
1235 }
1236
1237 v4->uSpellIconID = pIconsFrameTable->FindIcon(v6);
1238 if (v4->bRender)
1239 v4->uSpellAnimTime = 8 * pIconsFrameTable->pIcons[v4->uSpellIconID].uAnimLength;
1240 }
1241
1242 //----- (004A8BDF) --------------------------------------------------------
1243 void stru6::FadeScreen__like_Turn_Undead_and_mb_Armageddon(unsigned int uDiffuseColor, unsigned int uFadeTime)
1244 {
1245 this->uFadeTime = uFadeTime;
1246 this->uFadeLength = uFadeTime;
1247 this->uFadeColor = uDiffuseColor;
1248 }
1249
1250 //----- (004A8BFC) --------------------------------------------------------
1251 int stru6::_4A8BFC() //for SPELL_LIGHT_PRISMATIC_LIGHT
1252 {
1253 uAnimLength = 8 * pSpriteFrameTable->pSpriteSFrames[pSpriteFrameTable->FastFindSprite("spell84")].uAnimLength;
1254 return uAnimLength;
1255 }
1256
1257 //----- (004A8C27) --------------------------------------------------------
1258 void stru6::RenderSpecialEffects()
1259 {
1260 double v4; // st7@4
1261 double v5; // st6@4
1262 float v7; // ST14_4@6
1263 unsigned int v8; // ST14_4@8
1264 SpriteFrame *v10; // eax@8
1265 int v11; // edi@8
1266 RenderVertexD3D3 vd3d[4]; // [sp+60h] [bp-8Ch]@9
1267
1268 if (uNumProjectiles)
1269 {
1270 DrawProjectiles();
1271 uNumProjectiles = 0;
1272 }
1273
1274 field_204 = 0;
1275 if ( uFadeTime > 0 )
1276 {
1277 v4 = (double)uFadeTime / (double)uFadeLength;
1278 v5 = 1.0 - v4 * v4;
1279 //v6 = v5;
1280 if ( v5 > 0.9 )
1281 v5 = 1.0 - (v5 - 0.9) * 10.0;
1282 v7 = v5;
1283 pRenderer->ScreenFade(uFadeColor, v7);
1284 uFadeTime -= pEventTimer->uTimeElapsed;
1285 }
1286
1287 if (uAnimLength > 0)
1288 {
1289 v8 = 8 * pSpriteFrameTable->pSpriteSFrames[pSpriteFrameTable->FastFindSprite("spell84")].uAnimLength - uAnimLength;
1290 v10 = pSpriteFrameTable->GetFrame(pSpriteFrameTable->FastFindSprite("spell84"), v8);
1291 v11 = v10->pHwSpriteIDs[0];
1292 uAnimLength -= pEventTimer->uTimeElapsed;
1293 //if ( pRenderer->pRenderD3D )
1294 //{
1295 vd3d[0].pos.x = (double)(signed int)pViewport->uViewportTL_X;
1296 vd3d[0].pos.y = (double)(signed int)pViewport->uViewportTL_Y;
1297 vd3d[0].pos.z = 0.0;
1298 vd3d[0].diffuse = 0x7F7F7Fu;
1299 vd3d[0].specular = 0;
1300 vd3d[0].rhw = 1.0;
1301 vd3d[0].texcoord.x = 0.0;
1302 vd3d[0].texcoord.y = 0.0;
1303
1304 vd3d[1].pos.x = (double)(signed int)pViewport->uViewportTL_X;
1305 vd3d[1].pos.y = (double)(pViewport->uViewportBR_Y + 1);
1306 vd3d[1].pos.z = 0.0;
1307 vd3d[1].diffuse = 0x7F7F7Fu;
1308 vd3d[1].specular = 0;
1309 vd3d[1].rhw = 1.0;
1310 vd3d[1].texcoord.x = 0.0;
1311 vd3d[1].texcoord.y = 1.0;
1312
1313 vd3d[2].pos.x = (double)(signed int)pViewport->uViewportBR_X;
1314 vd3d[2].pos.y = (double)(pViewport->uViewportBR_Y + 1);
1315 vd3d[2].pos.z = 0.0;
1316 vd3d[2].diffuse = 0x7F7F7Fu;
1317 vd3d[2].specular = 0;
1318 vd3d[2].rhw = 1.0;
1319 vd3d[2].texcoord.x = 1.0;
1320 vd3d[2].texcoord.y = 1.0;
1321
1322 vd3d[3].pos.x = (double)(signed int)pViewport->uViewportBR_X;
1323 vd3d[3].pos.y = (double)(signed int)pViewport->uViewportTL_Y;
1324 vd3d[3].pos.z = 0.0;
1325 vd3d[3].diffuse = 0x7F7F7Fu;
1326 vd3d[3].specular = 0;
1327 vd3d[3].rhw = 1.0;
1328 vd3d[3].texcoord.x = 1.0;
1329 vd3d[3].texcoord.y = 0.0;
1330
1331 pRenderer->DrawSpecialEffectsQuad(vd3d, pSprites_LOD->pHardwareSprites[v11].pTexture);
1332 //}
1333 /*else
1334 {
1335 vsr.pTarget = pRenderer->pTargetSurface;
1336 vsr.sParentBillboardID = -1;
1337 vsr.pTargetZ = pRenderer->pActiveZBuffer;
1338 vsr.uScreenSpaceX = (signed int)(pViewport->uViewportBR_X - pViewport->uViewportTL_X) / 2;
1339 vsr.uScreenSpaceY = pViewport->uViewportBR_Y;
1340 v24 = 16777216;
1341 LODWORD(v18) = 0;
1342 HIDWORD(v18) = (signed __int16)(LOWORD(pViewport->uViewportBR_X) - LOWORD(pViewport->uViewportTL_X));
1343 vsr._screenspace_x_scaler_packedfloat = v18 / 0x1000000;
1344 LODWORD(v18) = 0;
1345 HIDWORD(v18) = (signed __int16)(LOWORD(pViewport->uViewportBR_Y) - LOWORD(pViewport->uViewportTL_Y));
1346 v26 = v18 / 16777216;
1347 vsr._screenspace_y_scaler_packedfloat = v18 / 0x1000000;
1348 vsr.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v70->uPaletteIndex, 0, 1);
1349 vsr.uTargetPitch = pRenderer->uTargetSurfacePitch;
1350 vsr.sParentBillboardID = -1;
1351 vsr.uViewportX = pViewport->uViewportTL_X;
1352 vsr.uViewportZ = pViewport->uViewportBR_X;
1353 vsr.uViewportY = pViewport->uViewportTL_Y;
1354 vsr.sZValue = 0;
1355 vsr.uViewportW = pViewport->uViewportBR_Y;
1356 vsr.uFlags = 0;
1357 if ( v11 >= 0 )
1358 pSprites_LOD->pSpriteHeaders[v11].DrawSprite_sw(&vsr, 1);
1359 }*/
1360 }
1361 }
1362
1363 //----- (004A902A) --------------------------------------------------------
1364 void stru6::DrawPlayerBuffAnims()
1365 {
1366 for (uint i = 0; i < 4; ++i)
1367 {
1368 PlayerBuffAnim* buff = &pPlayerBuffs[i];
1369 if (!buff->bRender)
1370 continue;
1371
1372 buff->uSpellAnimTimeElapsed += pEventTimer->uTimeElapsed;
1373 if (buff->uSpellAnimTimeElapsed >= buff->uSpellAnimTime)
1374 {
1375 buff->bRender = false;
1376 continue;
1377 }
1378
1379 IconFrame* icon = pIconsFrameTable->GetFrame(buff->uSpellIconID, buff->uSpellAnimTimeElapsed);
1380 pRenderer->DrawTextureIndexedAlpha(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 385, pIcons_LOD->GetTexture(icon->uTextureID));
1381
1382 pOtherOverlayList->bRedraw = true;
1383 }
1384 }
1385
1386 //----- (004A90A0) --------------------------------------------------------
1387 void stru6::LoadAnimations()
1388 {
1389 uTextureID_effpar1 = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT);
1390 uTextureID_effpar2 = pBitmaps_LOD->LoadTexture("effpar02", TEXTURE_DEFAULT);
1391 uTextureID_effpar3 = pBitmaps_LOD->LoadTexture("effpar03", TEXTURE_DEFAULT);
1392 uSpriteID_sp57c = pSprites_LOD->LoadSprite("sp57c", 6);
1393
1394 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("zapp"));
1395 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spheal1"));
1396 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spheal2"));
1397 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spheal3"));
1398 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spboost1"));
1399 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spboost2"));
1400 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spboost3"));
1401 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell03"));
1402 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell05"));
1403 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell14"));
1404 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell17"));
1405 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell21"));
1406 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell25"));
1407 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell27"));
1408 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell36"));
1409 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell38"));
1410 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell46"));
1411 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell51"));
1412 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell55"));
1413 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell58"));
1414 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell69"));
1415 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell71"));
1416 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell73"));
1417 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell75"));
1418 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell96"));
1419
1420 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell01"));
1421 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell02"));
1422 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell03"));
1423 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell09"));
1424 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell11"));
1425 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell18"));
1426 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell22"));
1427 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell26"));
1428 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell29"));
1429 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell39"));
1430 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell39c"));
1431 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell41"));
1432 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell57c"));
1433 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell62"));
1434 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell65"));
1435 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell66"));
1436 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell70"));
1437 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell76"));
1438 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell84"));
1439 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell90"));
1440 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell92"));
1441 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell93"));
1442 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell97"));
1443 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell97c"));
1444 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell97c"));
1445 }
1446
1447 //----- (004775ED) --------------------------------------------------------
1448 int stru6_stru1_indoor_sw_billboard::_4775ED(float a2)
1449 {
1450 char *v2; // edi@1
1451 //int v3; // eax@1
1452 char *v4; // edx@2
1453 char *v5; // esi@3
1454 double v6; // st7@6
1455 signed __int64 v7; // ST84_8@6
1456 double v8; // ST0C_8@6
1457 int v9; // esi@6
1458 double v10; // ST44_8@6
1459 int v11; // ecx@6
1460 double v12; // ST34_8@6
1461 int v13; // ecx@6
1462 double v14; // ST14_8@6
1463 double v15; // st7@8
1464 unsigned int v16; // ecx@8
1465 signed __int64 v17; // ST64_8@8
1466 double v18; // ST24_8@8
1467 int v19; // edi@8
1468 double v20; // ST3C_8@8
1469 int v21; // ecx@8
1470 double v22; // ST2C_8@8
1471 int v23; // ST9C_4@8
1472 double v24; // ST1C_8@8
1473 int *v25; // edi@8
1474 int v26; // esi@8
1475 int *v27; // edi@10
1476 int v28; // esi@10
1477 // int result; // eax@12
1478 __int64 v30; // [sp+A8h] [bp-30h]@8
1479 float v31; // [sp+B0h] [bp-28h]@6
1480 float v32; // [sp+B4h] [bp-24h]@6
1481 int v33; // [sp+B8h] [bp-20h]@6
1482 int v34; // [sp+BCh] [bp-1Ch]@2
1483 stru6_stru1_indoor_sw_billboard *v35; // [sp+C0h] [bp-18h]@1
1484 float v36; // [sp+C4h] [bp-14h]@6
1485 int v37; // [sp+C8h] [bp-10h]@6
1486 int v38; // [sp+CCh] [bp-Ch]@1
1487 float v39; // [sp+D0h] [bp-8h]@6
1488 int *v40; // [sp+D4h] [bp-4h]@2
1489
1490 // __debugbreak();//нужно почистить, срабатывает при применении закла Точечный взрыв и при стрельбе из жезла
1491 v2 = (char *)&this->field_64[4 * this->uNumVertices];
1492 v38 = 0;
1493 *(int *)v2 = this->field_64[0];
1494 v2 += 4;
1495 *(int *)v2 = this->field_64[1];
1496 v2 += 4;
1497 *(int *)v2 = this->field_64[2];
1498 *((int *)v2 + 1) = this->field_64[3];
1499 //v3 = this->uNumVertices;
1500 v35 = this;
1501 if (this->uNumVertices > 0)
1502 {
1503 v40 = &this->field_64[20];
1504 v4 = (char *)&this->field_64[3] + 3;
1505
1506 //while ( 1 )
1507 for (v34 = this->uNumVertices; v34; --v34)
1508 {
1509 v5 = v4 - 15;
1510 if (*(float *)(v4 - 15) <= (double)a2 && *(float *)(v4 + 1) <= (double)a2)
1511 {
1512 v4 += 16;
1513 //--v34;
1514 //if ( !v34 )
1515 //return this->uNumVertices = v38;
1516 continue;
1517 }
1518 if (*(float *)v5 <= (double)a2)
1519 {
1520 v6 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5);
1521 v7 = (unsigned __int8)v4[16] - (unsigned int)(unsigned __int8)*v4;
1522 v36 = v6;
1523 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v6 + *(float *)(v4 - 11);
1524 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v6 + *(float *)(v4 - 7);
1525 *(float *)&v37 = (double)v7 * v6;
1526 v8 = *(float *)&v37 + 6.7553994e15;
1527 v9 = (unsigned __int8)*v4;
1528 *(float *)&v37 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36;
1529 v10 = *(float *)&v37 + 6.7553994e15;
1530 v11 = (unsigned __int8)*(v4 - 2);
1531 v37 = LODWORD(v10) + (unsigned __int8)*(v4 - 1);
1532 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v11) * v36;
1533 v12 = v39 + 6.7553994e15;
1534 v13 = LODWORD(v12) + (unsigned __int8)*(v4 - 2);
1535 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36;
1536 v14 = v39 + 6.7553994e15;
1537 v33 = (LODWORD(v14) + (*(int *)(v4 - 3) & 0xFF)) | ((v13 | ((v37 | ((LODWORD(v8) + v9) << 8)) << 8)) << 8);
1538 //this = v35;
1539 v5 = (char *)&v30 + 4;
1540 }
1541 else if (*(float *)(v4 + 1) <= (double)a2)
1542 {
1543 v15 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5);
1544 v16 = (unsigned __int8)*v4;
1545 HIDWORD(v30) = LODWORD(a2);
1546 v17 = (unsigned __int8)v4[16] - v16;
1547 v36 = v15;
1548 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v15 + *(float *)(v4 - 11);
1549 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v15 + *(float *)(v4 - 7);
1550 v39 = (double)v17 * v15;
1551 v18 = v39 + 6.7553994e15;
1552 v19 = (unsigned __int8)*v4;
1553 v39 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36;
1554 v20 = v39 + 6.7553994e15;
1555 v21 = (unsigned __int8)*(v4 - 2);
1556 v37 = LODWORD(v20) + (unsigned __int8)*(v4 - 1);
1557 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v21) * v36;
1558 v22 = v39 + 6.7553994e15;
1559 v23 = LODWORD(v22) + (unsigned __int8)*(v4 - 2);
1560 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36;
1561 v24 = v39 + 6.7553994e15;
1562 v33 = (LODWORD(v24) + (*(int *)(v4 - 3) & 0xFF)) | ((v23 | ((v37 | ((LODWORD(v18) + v19) << 8)) << 8)) << 8);
1563 v25 = v40;
1564 *v40 = *(int *)v5;
1565 v26 = (int)(v5 + 4);
1566 ++v25;
1567 *v25 = *(int *)v26;
1568 v26 += 4;
1569 ++v25;
1570 ++v38;
1571 v40 += 4;
1572 *v25 = *(int *)v26;
1573 v25[1] = *(int *)(v26 + 4);
1574 v5 = (char *)&v30 + 4;
1575 }
1576 v27 = v40;
1577 ++v38;
1578 *v40 = *(int *)v5;
1579 v28 = (int)(v5 + 4);
1580 ++v27;
1581 *v27 = *(int *)v28;
1582 v28 += 4;
1583 ++v27;
1584 v40 += 4;
1585 *v27 = *(int *)v28;
1586 v27[1] = *(int *)(v28 + 4);
1587 v4 += 16;
1588 //--v34;
1589 //if ( !v34 )
1590 //return this->uNumVertices = v38;
1591 }
1592 }
1593 return this->uNumVertices = v38;
1594 }
1595
1596 //----- (00477927) --------------------------------------------------------
1597 int stru6_stru1_indoor_sw_billboard::_477927(float a2)
1598 {
1599 char *v2; // edi@1
1600 int v3; // eax@1
1601 char *v4; // edx@2
1602 char *v5; // esi@3
1603 double v6; // st7@6
1604 signed __int64 v7; // ST84_8@6
1605 double v8; // ST0C_8@6
1606 int v9; // esi@6
1607 double v10; // ST44_8@6
1608 int v11; // ecx@6
1609 double v12; // ST34_8@6
1610 int v13; // ecx@6
1611 double v14; // ST14_8@6
1612 double v15; // st7@8
1613 unsigned int v16; // ecx@8
1614 signed __int64 v17; // ST64_8@8
1615 double v18; // ST24_8@8
1616 int v19; // edi@8
1617 double v20; // ST3C_8@8
1618 int v21; // ecx@8
1619 double v22; // ST2C_8@8
1620 int v23; // ST9C_4@8
1621 double v24; // ST1C_8@8
1622 int *v25; // edi@8
1623 int v26; // esi@8
1624 int *v27; // edi@10
1625 int v28; // esi@10
1626 // int result; // eax@12
1627 __int64 v30; // [sp+A8h] [bp-30h]@8
1628 float v31; // [sp+B0h] [bp-28h]@6
1629 float v32; // [sp+B4h] [bp-24h]@6
1630 int v33; // [sp+B8h] [bp-20h]@6
1631 int v34; // [sp+BCh] [bp-1Ch]@2
1632 stru6_stru1_indoor_sw_billboard *v35; // [sp+C0h] [bp-18h]@1
1633 float v36; // [sp+C4h] [bp-14h]@6
1634 int v37; // [sp+C8h] [bp-10h]@6
1635 int v38; // [sp+CCh] [bp-Ch]@1
1636 float v39; // [sp+D0h] [bp-8h]@6
1637 int *v40; // [sp+D4h] [bp-4h]@2
1638
1639 __debugbreak();//нужно почистить
1640 v2 = (char *)&this->field_64[4 * this->uNumVertices];
1641 v38 = 0;
1642 *(int *)v2 = this->field_64[0];
1643 v2 += 4;
1644 *(int *)v2 = this->field_64[1];
1645 v2 += 4;
1646 *(int *)v2 = this->field_64[2];
1647 *((int *)v2 + 1) = this->field_64[3];
1648 v3 = this->uNumVertices;
1649 v35 = this;
1650 if (v3 > 0)
1651 {
1652 v40 = &this->field_64[20];
1653 v4 = (char *)&this->field_64[3] + 3;
1654 v34 = v3;
1655 while (1)
1656 {
1657 v5 = v4 - 15;
1658 if (*(float *)(v4 - 15) >= (double)a2 && *(float *)(v4 + 1) >= (double)a2)
1659 {
1660 v4 += 16;
1661 --v34;
1662 if (!v34)
1663 return this->uNumVertices = v38;
1664 continue;
1665 }
1666 if (*(float *)v5 >= (double)a2)
1667 {
1668 v6 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5);
1669 v7 = (unsigned __int8)v4[16] - (unsigned int)(unsigned __int8)*v4;
1670 v36 = v6;
1671 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v6 + *(float *)(v4 - 11);
1672 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v6 + *(float *)(v4 - 7);
1673 *(float *)&v37 = (double)v7 * v6;
1674 v8 = *(float *)&v37 + 6.7553994e15;
1675 v9 = (unsigned __int8)*v4;
1676 *(float *)&v37 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36;
1677 v10 = *(float *)&v37 + 6.7553994e15;
1678 v11 = (unsigned __int8)*(v4 - 2);
1679 v37 = LODWORD(v10) + (unsigned __int8)*(v4 - 1);
1680 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v11) * v36;
1681 v12 = v39 + 6.7553994e15;
1682 v13 = LODWORD(v12) + (unsigned __int8)*(v4 - 2);
1683 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36;
1684 v14 = v39 + 6.7553994e15;
1685 v33 = (LODWORD(v14) + (*(int *)(v4 - 3) & 0xFF)) | ((v13 | ((v37 | ((LODWORD(v8) + v9) << 8)) << 8)) << 8);
1686 //this = v35;
1687 v5 = (char *)&v30 + 4;
1688 }
1689 else if (*(float *)(v4 + 1) >= (double)a2)
1690 {
1691 v15 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5);
1692 v16 = (unsigned __int8)*v4;
1693 HIDWORD(v30) = LODWORD(a2);
1694 v17 = (unsigned __int8)v4[16] - v16;
1695 v36 = v15;
1696 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v15 + *(float *)(v4 - 11);
1697 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v15 + *(float *)(v4 - 7);
1698 v39 = (double)v17 * v15;
1699 v18 = v39 + 6.7553994e15;
1700 v19 = (unsigned __int8)*v4;
1701 v39 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36;
1702 v20 = v39 + 6.7553994e15;
1703 v21 = (unsigned __int8)*(v4 - 2);
1704 v37 = LODWORD(v20) + (unsigned __int8)*(v4 - 1);
1705 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v21) * v36;
1706 v22 = v39 + 6.7553994e15;
1707 v23 = LODWORD(v22) + (unsigned __int8)*(v4 - 2);
1708 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36;
1709 v24 = v39 + 6.7553994e15;
1710 v33 = (LODWORD(v24) + (*(int *)(v4 - 3) & 0xFF)) | ((v23 | ((v37 | ((LODWORD(v18) + v19) << 8)) << 8)) << 8);
1711 v25 = v40;
1712 *v40 = *(int *)v5;
1713 v26 = (int)(v5 + 4);
1714 ++v25;
1715 *v25 = *(int *)v26;
1716 v26 += 4;
1717 ++v25;
1718 ++v38;
1719 v40 += 4;
1720 *v25 = *(int *)v26;
1721 v25[1] = *(int *)(v26 + 4);
1722 v5 = (char *)&v30 + 4;
1723 }
1724 v27 = v40;
1725 ++v38;
1726 *v40 = *(int *)v5;
1727 v28 = (int)(v5 + 4);
1728 ++v27;
1729 *v27 = *(int *)v28;
1730 v28 += 4;
1731 ++v27;
1732 v40 += 4;
1733 *v27 = *(int *)v28;
1734 v27[1] = *(int *)(v28 + 4);
1735 v4 += 16;
1736 --v34;
1737 if (!v34)
1738 return this->uNumVertices = v38;
1739 }
1740 }
1741 return this->uNumVertices = v38;
1742 }
1743
1744 //----- (00477C61) --------------------------------------------------------
1745 int stru6_stru1_indoor_sw_billboard::sub_477C61()
1746 {
1747 //stru6_stru1_indoor_sw_billboard *v1; // ebx@1
1748 int v2; // ecx@2
1749 int v3; // eax@3
1750 double v4; // st7@4
1751 double v5; // st7@5
1752 double v6; // st6@5
1753 double v7; // st5@6
1754 float v8; // ST30_4@8
1755 float v9; // ST24_4@8
1756 double v10; // st7@8
1757 double v11; // st6@8
1758 double v12; // st5@8
1759 float v13; // ST24_4@13
1760 int v14; // esi@13
1761 char *v15; // esi@15
1762 //signed int v16; // eax@16
1763 // __int16 v17; // fps@16
1764 // unsigned __int8 v18; // c2@16
1765 // unsigned __int8 v19; // c3@16
1766 double v20; // st6@16
1767 float v21; // ST18_4@17
1768 float v22; // ST2C_4@17
1769 float v23; // ST34_4@17
1770 float v24; // ST24_4@17
1771 double v25; // st7@17
1772 double v26; // st6@17
1773 float v27; // ST34_4@18
1774 float v28; // ST30_4@18
1775 int v29; // eax@19
1776 signed int v31; // [sp+8h] [bp-28h]@15
1777 float v32; // [sp+Ch] [bp-24h]@16
1778 float v33; // [sp+14h] [bp-1Ch]@16
1779 float v34; // [sp+18h] [bp-18h]@16
1780 float v35; // [sp+1Ch] [bp-14h]@17
1781 float v36; // [sp+20h] [bp-10h]@4
1782 float v37; // [sp+24h] [bp-Ch]@4
1783 float v38; // [sp+24h] [bp-Ch]@16
1784 float v39; // [sp+28h] [bp-8h]@9
1785 float v40; // [sp+28h] [bp-8h]@16
1786 float v41; // [sp+2Ch] [bp-4h]@6
1787 float v42; // [sp+2Ch] [bp-4h]@9
1788
1789 //__debugbreak();//нужно почистить, срабатывает при применении закла Точечный взрыв
1790 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
1791 {
1792
1793 if (this->uNumVertices > 0)
1794 {
1795 v3 = (int)&this->field_14[1];
1796 //do
1797 for (v2 = 0; v2 < this->uNumVertices; ++v2)
1798 {
1799 v4 = *(float *)(v3 - 4);
1800 LODWORD(v37) = *(int *)v3;
1801 LODWORD(v36) = *(int *)(v3 + 4);
1802 if (pIndoorCameraD3D->sRotationX)
1803 {
1804 v5 = v4 - (double)pIndoorCameraD3D->vPartyPos.x;
1805 v6 = v37 - (double)pIndoorCameraD3D->vPartyPos.y;
1806 //if ( pRenderer->pRenderD3D )
1807 //{
1808 v41 = pIndoorCameraD3D->fRotationYSine * v6 + pIndoorCameraD3D->fRotationYCosine * v5;
1809 v7 = pIndoorCameraD3D->fRotationYSine * v5 - pIndoorCameraD3D->fRotationYCosine * v6;
1810 /*}
1811 else
1812 {
1813 v41 = pBLVRenderParams->fCosineY * v5 - pBLVRenderParams->fSineY * v6;
1814 v7 = pBLVRenderParams->fSineY * v5 + pBLVRenderParams->fCosineY * v6;
1815 }*/
1816 v8 = v7;
1817 v9 = v36 - (double)pIndoorCameraD3D->vPartyPos.z;
1818 v10 = pIndoorCameraD3D->fRotationXCosine * v41 - pIndoorCameraD3D->fRotationXSine * v9;
1819 v11 = v8;
1820 v12 = pIndoorCameraD3D->fRotationXCosine * v9 + pIndoorCameraD3D->fRotationXSine * v41;
1821 }
1822 else
1823 {
1824 v42 = v4 - (double)pIndoorCameraD3D->vPartyPos.x;
1825 v39 = v37 - (double)pIndoorCameraD3D->vPartyPos.y;
1826 //if ( pRenderer->pRenderD3D )
1827 //{
1828 v10 = pIndoorCameraD3D->fRotationYSine * v39 + pIndoorCameraD3D->fRotationYCosine * v42;
1829 v11 = pIndoorCameraD3D->fRotationYSine * v42 - pIndoorCameraD3D->fRotationYCosine * v39;
1830 /*}
1831 else
1832 {
1833 v10 = pBLVRenderParams->fCosineY * v42 - pBLVRenderParams->fSineY * v39;
1834 v11 = pBLVRenderParams->fSineY * v42 + pBLVRenderParams->fCosineY * v39;
1835 }*/
1836 v12 = v36 - (double)pIndoorCameraD3D->vPartyPos.z;
1837 }
1838 v13 = v12;
1839 //++v2;
1840 *(int *)(v3 + 84) = LODWORD(v13);
1841 v14 = *(int *)(v3 + 8);
1842 *(float *)(v3 + 76) = v10;
1843 *(int *)(v3 + 88) = v14;
1844 *(float *)(v3 + 80) = v11;
1845 v3 += 16;
1846 }
1847 //while ( v2 < this->uNumVertices );
1848 }
1849 }
1850 else
1851 {
1852 v15 = (char *)&this->field_14[1];
1853 //do
1854 for (v31 = 3; v31; --v31)
1855 {
1856 v40 = (double)stru_5C6E00->Cos(pIndoorCameraD3D->sRotationX) * 0.0000152587890625;
1857 v32 = (double)stru_5C6E00->Sin(pIndoorCameraD3D->sRotationX) * 0.0000152587890625;
1858 v34 = (double)stru_5C6E00->Cos(pIndoorCameraD3D->sRotationY) * 0.0000152587890625;
1859 v33 = (double)stru_5C6E00->Sin(pIndoorCameraD3D->sRotationY) * 0.0000152587890625;
1860 //v16 = stru_5C6E00->Sin(pODMRenderParams->rotation_y);
1861 LODWORD(v38) = *(int *)v15;
1862 //UNDEF(v17);
1863 v20 = *((float *)v15 - 1) - (double)pIndoorCameraD3D->vPartyPos.x;
1864 //if ( v19 | v18 )
1865 if (pIndoorCameraD3D->vPartyPos.x == 0)
1866 {
1867 v27 = v20;
1868 LODWORD(v35) = *((int *)v15 + 1);
1869 v28 = v38 - (double)pIndoorCameraD3D->vPartyPos.y;
1870 v25 = v33 * v28 + v34 * v27;
1871 v26 = v34 * v28 - v33 * v27;
1872 }
1873 else
1874 {
1875 v21 = v20;
1876 v22 = v38 - (double)pIndoorCameraD3D->vPartyPos.y;
1877 v23 = v33 * v22 + v34 * v21;
1878 v24 = *((float *)v15 + 1) - (double)pIndoorCameraD3D->vPartyPos.z;
1879 v25 = v32 * v24 + v40 * v23;
1880 v26 = v34 * v22 - v33 * v21;
1881 v35 = v40 * v24 - v32 * v23;
1882 }
1883 *((int *)v15 + 21) = LODWORD(v35);
1884 v29 = *((int *)v15 + 2);
1885 *((float *)v15 + 19) = v25;
1886 *((int *)v15 + 22) = v29;
1887 *((float *)v15 + 20) = v26;
1888 v15 += 16;
1889 //--v31;
1890 }
1891 //while ( v31 );
1892 }
1893 this->uNumVertices = 3;
1894 return 1;
1895 }
1896
1897 //----- (00477F63) --------------------------------------------------------
1898 bool stru6_stru1_indoor_sw_billboard::sub_477F63()
1899 {
1900 signed int v1; // ebx@1
1901 double v3; // st7@2
1902 //int v4; // edx@4
1903 char *v5; // ecx@5
1904 int v6; // edi@5
1905 float v7; // ST08_4@13
1906 signed int v9; // [sp+Ch] [bp-8h]@1
1907 float v10; // [sp+10h] [bp-4h]@2
1908
1909 //__debugbreak();// почистить
1910 v1 = 0;
1911 v9 = 0;
1912 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
1913 {
1914 v10 = 16192.0;
1915 v3 = (double)pBLVRenderParams->fov_rad_fixpoint * 0.000015258789;
1916 }
1917 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
1918 {
1919 v10 = (double)pODMRenderParams->shading_dist_mist;
1920 v3 = 8.0;
1921 }
1922 else
1923 __debugbreak();//Error
1924 if (this->uNumVertices <= 0)
1925 {
1926 memcpy(&this->field_14[40], &this->field_14[20], 16 * this->uNumVertices);
1927 return this->uNumVertices != 0;
1928 }
1929 v5 = (char *)&this->field_14[20];
1930 for (v6 = 0; v6 < this->uNumVertices; v6++)
1931 {
1932 if (v3 >= *(float *)v5 || *(float *)v5 >= (double)v10)
1933 {
1934 if (v3 < *(float *)v5)
1935 v9 = 1;
1936 else
1937 v1 = 1;
1938 }
1939 v5 += 16;
1940 }
1941 if (!v1)
1942 {
1943 if (v9)
1944 {
1945 this->_477927(v10);
1946 return this->uNumVertices != 0;
1947 }
1948 memcpy(&this->field_14[40], &this->field_14[20], 16 * this->uNumVertices);
1949 return this->uNumVertices != 0;
1950 }
1951 v7 = v3;
1952 _4775ED(v7);
1953 return this->uNumVertices != 0;
1954 }
1955
1956 //----- (0047802A) --------------------------------------------------------
1957 int stru6_stru1_indoor_sw_billboard::sub_47802A()
1958 {
1959 double v6; // st7@4
1960 signed int v16; // [sp+38h] [bp-Ch]@1
1961 int a6; // [sp+3Ch] [bp-8h]@5
1962 int a5; // [sp+40h] [bp-4h]@5
1963
1964 // __debugbreak(); //необходимо проверить this->field_B4[i*4+16]
1965 v16 = 0;
1966 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
1967 {
1968 for (int i = 0; i < this->uNumVertices; i++)
1969 {
1970 v6 = (double)pBLVRenderParams->fov_rad_fixpoint * 0.000015258789 / this->field_B4[i * 4];
1971 //if ( pRenderer->pRenderD3D )
1972 {
1973 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]),
1974 &a5, &a6);
1975 this->field_B4[i * 4 + 16] = (double)a5;
1976 this->field_B4[i * 4 + 17] = (double)a6;
1977 this->field_B4[i * 4 + 18] = round_to_int(this->field_B4[i * 4]);
1978 }
1979 /*else
1980 {
1981 this->field_B4[i*4+16] = (double)pBLVRenderParams->uViewportCenterX - v6 * this->field_B4[i*4+1];
1982 this->field_B4[i*4+17] = (double)pBLVRenderParams->uViewportCenterY - v6 * this->field_B4[i*4+2];
1983 this->field_B4[i*4+18] = this->field_B4[i*4];
1984 }*/
1985 this->field_B4[i * 4 + 19] = this->field_B4[i * 4 + 3];
1986 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]
1987 && (double)(signed int)pViewport->uViewportTL_Y <= this->field_B4[i * 4 + 17] && (double)(signed int)pViewport->uViewportBR_Y > this->field_B4[i * 4 + 17])
1988 v16 = 1;
1989 }
1990 }
1991 else
1992 {
1993 for (int i = 0; i < this->uNumVertices; i++)
1994 {
1995 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];
1996 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];
1997 *((int *)&this->field_B4[i * 4 + 22]) = (int)this->field_B4[i * 4];
1998 *((int *)&this->field_B4[i * 4 + 23]) = this->field_B4[i * 4 + 3];
1999 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]
2000 && (double)(signed int)pViewport->uViewportTL_Y <= this->field_B4[i * 4 + 21] && (double)(signed int)pViewport->uViewportBR_Y > this->field_B4[i * 4 + 21])
2001 v16 = 1;
2002 }
2003 }
2004 return v16;
2005 }