Mercurial > mm7
comparison Engine/Graphics/ParticleEngine.cpp @ 2543:b6140dfeac27
GameOver h/cpp
author | a.parshin |
---|---|
date | Sun, 10 May 2015 03:21:14 +0200 |
parents | a902abdfc7f2 |
children |
comparison
equal
deleted
inserted
replaced
2542:bacf9809126a | 2543:b6140dfeac27 |
---|---|
306 //uParticleID = LODWORD(pParticle->z); | 306 //uParticleID = LODWORD(pParticle->z); |
307 //z_int_ = *(float *)&uParticleID + 6.7553994e15; | 307 //z_int_ = *(float *)&uParticleID + 6.7553994e15; |
308 z_int_ = floorf(pParticle->z + 0.5f); | 308 z_int_ = floorf(pParticle->z + 0.5f); |
309 /*if ( !pRenderer->pRenderD3D ) | 309 /*if ( !pRenderer->pRenderD3D ) |
310 { | 310 { |
311 if (pEngine->pIndoorCameraD3D->sRotationX) | 311 if (pIndoorCameraD3D->sRotationX) |
312 { | 312 { |
313 if (pParticle->type & ParticleType_Line) | 313 if (pParticle->type & ParticleType_Line) |
314 { | 314 { |
315 //v11 = pParticle->_x + 6.7553994e15; | 315 //v11 = pParticle->_x + 6.7553994e15; |
316 int _uParticleID = (int)(floorf(pParticle->_x + 0.5f) - pBLVRenderParams->vPartyPos.x) << 16; | 316 int _uParticleID = (int)(floorf(pParticle->_x + 0.5f) - pBLVRenderParams->vPartyPos.x) << 16; |
317 //v12 = pParticle->_y + 6.7553994e15; | 317 //v12 = pParticle->_y + 6.7553994e15; |
318 y = (int)(floorf(pParticle->_y + 0.5f) - pBLVRenderParams->vPartyPos.y) << 16; | 318 y = (int)(floorf(pParticle->_y + 0.5f) - pBLVRenderParams->vPartyPos.y) << 16; |
319 z = (unsigned __int64)(y * (signed __int64)pEngine->pIndoorCameraD3D->int_sine_y) >> 16; | 319 z = (unsigned __int64)(y * (signed __int64)pIndoorCameraD3D->int_sine_y) >> 16; |
320 HIDWORD(a5) = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_y) >> 16) | 320 HIDWORD(a5) = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_cosine_y) >> 16) |
321 - z; | 321 - z; |
322 a6 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_sine_y) >> 16; | 322 a6 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_sine_y) >> 16; |
323 //v13 = pParticle->_z + 6.7553994e15; | 323 //v13 = pParticle->_z + 6.7553994e15; |
324 _uParticleID = (int)(floorf(pParticle->_z + 0.5f) - pBLVRenderParams->vPartyPos.z) << 16; | 324 _uParticleID = (int)(floorf(pParticle->_z + 0.5f) - pBLVRenderParams->vPartyPos.z) << 16; |
325 z = ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_x) >> 16) | 325 z = ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pIndoorCameraD3D->int_cosine_x) >> 16) |
326 - ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_sine_x) >> 16); | 326 - ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_sine_x) >> 16); |
327 v14 = z; | 327 v14 = z; |
328 HIDWORD(v13) = (unsigned __int64)(SHIDWORD(a5) * (signed __int64)pEngine->pIndoorCameraD3D->int_sine_x) >> 16; | 328 HIDWORD(v13) = (unsigned __int64)(SHIDWORD(a5) * (signed __int64)pIndoorCameraD3D->int_sine_x) >> 16; |
329 HIDWORD(a5) = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_x) >> 16; | 329 HIDWORD(a5) = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_cosine_x) >> 16; |
330 //LODWORD(v15) = pBLVRenderParams->field_40 << 16; | 330 //LODWORD(v15) = pBLVRenderParams->field_40 << 16; |
331 //HIDWORD(v15) = pBLVRenderParams->field_40 >> 16; | 331 //HIDWORD(v15) = pBLVRenderParams->field_40 >> 16; |
332 //v16 = v15 / z; | 332 //v16 = v15 / z; |
333 v16 = fixpoint_div(pBLVRenderParams->field_40, z); | 333 v16 = fixpoint_div(pBLVRenderParams->field_40, z); |
334 v17 = (unsigned __int64)(y * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_y) >> 16; | 334 v17 = (unsigned __int64)(y * (signed __int64)pIndoorCameraD3D->int_cosine_y) >> 16; |
335 pParticle->_screenspace_scale = v16; | 335 pParticle->_screenspace_scale = v16; |
336 _uParticleID = (unsigned __int64)(v16 * (signed __int64)(a6 + v17)) >> 16; | 336 _uParticleID = (unsigned __int64)(v16 * (signed __int64)(a6 + v17)) >> 16; |
337 LODWORD(v18) = pBLVRenderParams->uViewportCenterX | 337 LODWORD(v18) = pBLVRenderParams->uViewportCenterX |
338 - ((signed int)((unsigned __int64)(v16 * (signed __int64)(a6 + v17)) >> 16) >> 16); | 338 - ((signed int)((unsigned __int64)(v16 * (signed __int64)(a6 + v17)) >> 16) >> 16); |
339 v19 = pParticle->_screenspace_scale; | 339 v19 = pParticle->_screenspace_scale; |
344 pParticle->sZValue2 = v14; | 344 pParticle->sZValue2 = v14; |
345 pParticle->uScreenSpaceW = v20; | 345 pParticle->uScreenSpaceW = v20; |
346 } | 346 } |
347 int _uParticleID = (x_int - pBLVRenderParams->vPartyPos.x) << 16; | 347 int _uParticleID = (x_int - pBLVRenderParams->vPartyPos.x) << 16; |
348 y = (y_int_ - pBLVRenderParams->vPartyPos.y) << 16; | 348 y = (y_int_ - pBLVRenderParams->vPartyPos.y) << 16; |
349 HIDWORD(a5) = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_y) >> 16) | 349 HIDWORD(a5) = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_cosine_y) >> 16) |
350 - ((unsigned __int64)(y * (signed __int64)pEngine->pIndoorCameraD3D->int_sine_y) >> 16); | 350 - ((unsigned __int64)(y * (signed __int64)pIndoorCameraD3D->int_sine_y) >> 16); |
351 a6 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_sine_y) >> 16; | 351 a6 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_sine_y) >> 16; |
352 z_int_4 = (unsigned __int64)(y * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_y) >> 16; | 352 z_int_4 = (unsigned __int64)(y * (signed __int64)pIndoorCameraD3D->int_cosine_y) >> 16; |
353 _uParticleID = (z_int_ - pBLVRenderParams->vPartyPos.z) << 16; | 353 _uParticleID = (z_int_ - pBLVRenderParams->vPartyPos.z) << 16; |
354 v21 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_sine_x) >> 16; | 354 v21 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_sine_x) >> 16; |
355 v22 = ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_x) >> 16) - v21; | 355 v22 = ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pIndoorCameraD3D->int_cosine_x) >> 16) - v21; |
356 z = ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_x) >> 16) - v21; | 356 z = ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pIndoorCameraD3D->int_cosine_x) >> 16) - v21; |
357 if ( v22 < (signed int)0x40000u || v22 > (signed int)0x1F400000u ) | 357 if ( v22 < (signed int)0x40000u || v22 > (signed int)0x1F400000u ) |
358 return 0; | 358 return 0; |
359 v23 = a6 + z_int_4; | 359 v23 = a6 + z_int_4; |
360 a2 = a6 + z_int_4; | 360 a2 = a6 + z_int_4; |
361 v24 = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_x) >> 16) | 361 v24 = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_cosine_x) >> 16) |
362 + ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pEngine->pIndoorCameraD3D->int_sine_x) >> 16); | 362 + ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pIndoorCameraD3D->int_sine_x) >> 16); |
363 } | 363 } |
364 else | 364 else |
365 { | 365 { |
366 if (pParticle->type & ParticleType_Line) | 366 if (pParticle->type & ParticleType_Line) |
367 { | 367 { |
368 //v25 = pParticle->_x + 6.7553994e15; | 368 //v25 = pParticle->_x + 6.7553994e15; |
369 int _uParticleID = ((int)floorf(pParticle->_x + 0.5f) - pBLVRenderParams->vPartyPos.x) << 16; | 369 int _uParticleID = ((int)floorf(pParticle->_x + 0.5f) - pBLVRenderParams->vPartyPos.x) << 16; |
370 //v26 = pParticle->_y + 6.7553994e15; | 370 //v26 = pParticle->_y + 6.7553994e15; |
371 y = ((int)floorf(pParticle->_y + 0.5f) - pBLVRenderParams->vPartyPos.y) << 16; | 371 y = ((int)floorf(pParticle->_y + 0.5f) - pBLVRenderParams->vPartyPos.y) << 16; |
372 auto _hiword_v25 = (__int64)(y * (signed __int64)pEngine->pIndoorCameraD3D->int_sine_y) >> 16; | 372 auto _hiword_v25 = (__int64)(y * (signed __int64)pIndoorCameraD3D->int_sine_y) >> 16; |
373 v27 = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_y) >> 16) - _hiword_v25; | 373 v27 = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_cosine_y) >> 16) - _hiword_v25; |
374 z = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_y) >> 16) - _hiword_v25; | 374 z = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_cosine_y) >> 16) - _hiword_v25; |
375 v28 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_sine_y) >> 16; | 375 v28 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_sine_y) >> 16; |
376 //a5 = pParticle->_z + 6.7553994e15; | 376 //a5 = pParticle->_z + 6.7553994e15; |
377 v29 = ((int)floorf(pParticle->_z + 0.5f) - pBLVRenderParams->vPartyPos.z) << 16; | 377 v29 = ((int)floorf(pParticle->_z + 0.5f) - pBLVRenderParams->vPartyPos.z) << 16; |
378 //LODWORD(v30) = pBLVRenderParams->field_40 << 16; | 378 //LODWORD(v30) = pBLVRenderParams->field_40 << 16; |
379 //HIDWORD(v30) = pBLVRenderParams->field_40 >> 16; | 379 //HIDWORD(v30) = pBLVRenderParams->field_40 >> 16; |
380 //v31 = v30 / z; | 380 //v31 = v30 / z; |
381 v31 = fixpoint_div(pBLVRenderParams->field_40, z); | 381 v31 = fixpoint_div(pBLVRenderParams->field_40, z); |
382 v32 = (unsigned __int64)(y * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_y) >> 16; | 382 v32 = (unsigned __int64)(y * (signed __int64)pIndoorCameraD3D->int_cosine_y) >> 16; |
383 pParticle->_screenspace_scale = v31; | 383 pParticle->_screenspace_scale = v31; |
384 _uParticleID = (unsigned __int64)(v31 * (signed __int64)(v28 + v32)) >> 16; | 384 _uParticleID = (unsigned __int64)(v31 * (signed __int64)(v28 + v32)) >> 16; |
385 LODWORD(v33) = pBLVRenderParams->uViewportCenterX - ((signed int)((unsigned __int64)(v31 * (signed __int64)(v28 + v32)) >> 16) >> 16); | 385 LODWORD(v33) = pBLVRenderParams->uViewportCenterX - ((signed int)((unsigned __int64)(v31 * (signed __int64)(v28 + v32)) >> 16) >> 16); |
386 //v34 = pParticle->_screenspace_scale; | 386 //v34 = pParticle->_screenspace_scale; |
387 pParticle->uScreenSpaceZ = v33; | 387 pParticle->uScreenSpaceZ = v33; |
389 pParticle->sZValue2 = v27; | 389 pParticle->sZValue2 = v27; |
390 pParticle->uScreenSpaceW = v35; | 390 pParticle->uScreenSpaceW = v35; |
391 } | 391 } |
392 int _uParticleID = (x_int - pBLVRenderParams->vPartyPos.x) << 16; | 392 int _uParticleID = (x_int - pBLVRenderParams->vPartyPos.x) << 16; |
393 y = (y_int_ - pBLVRenderParams->vPartyPos.y) << 16; | 393 y = (y_int_ - pBLVRenderParams->vPartyPos.y) << 16; |
394 v36 = (unsigned __int64)(y * (signed __int64)pEngine->pIndoorCameraD3D->int_sine_y) >> 16; | 394 v36 = (unsigned __int64)(y * (signed __int64)pIndoorCameraD3D->int_sine_y) >> 16; |
395 v22 = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_y) >> 16) - v36; | 395 v22 = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_cosine_y) >> 16) - v36; |
396 z = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_y) >> 16) - v36; | 396 z = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_cosine_y) >> 16) - v36; |
397 if ( v22 < 262144 || v22 > 524288000 ) | 397 if ( v22 < 262144 || v22 > 524288000 ) |
398 return 0; | 398 return 0; |
399 v37 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_sine_y) >> 16; | 399 v37 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_sine_y) >> 16; |
400 _uParticleID = (unsigned __int64)(y * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_y) >> 16; | 400 _uParticleID = (unsigned __int64)(y * (signed __int64)pIndoorCameraD3D->int_cosine_y) >> 16; |
401 v23 = v37 + ((unsigned __int64)(y * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_y) >> 16); | 401 v23 = v37 + ((unsigned __int64)(y * (signed __int64)pIndoorCameraD3D->int_cosine_y) >> 16); |
402 a2 = v37 + ((unsigned __int64)(y * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_y) >> 16); | 402 a2 = v37 + ((unsigned __int64)(y * (signed __int64)pIndoorCameraD3D->int_cosine_y) >> 16); |
403 v24 = (z_int_ - pBLVRenderParams->vPartyPos.z) << 16; | 403 v24 = (z_int_ - pBLVRenderParams->vPartyPos.z) << 16; |
404 } | 404 } |
405 int _uParticleID = abs(v23); | 405 int _uParticleID = abs(v23); |
406 v38 = abs(v22); | 406 v38 = abs(v22); |
407 if ( v38 >= (signed int)_uParticleID ) | 407 if ( v38 >= (signed int)_uParticleID ) |
424 } | 424 } |
425 return false; | 425 return false; |
426 }*/ | 426 }*/ |
427 | 427 |
428 int x; | 428 int x; |
429 if ( !pEngine->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible_BLV( | 429 if ( !pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible_BLV( |
430 x_int, | 430 x_int, |
431 y_int_, | 431 y_int_, |
432 z_int_, | 432 z_int_, |
433 &x, | 433 &x, |
434 &y, | 434 &y, |
435 &z, | 435 &z, |
436 1) ) | 436 1) ) |
437 return false; | 437 return false; |
438 pEngine->pIndoorCameraD3D->Project(x, y, z, &pParticle->uScreenSpaceX, &pParticle->uScreenSpaceY); | 438 pIndoorCameraD3D->Project(x, y, z, &pParticle->uScreenSpaceX, &pParticle->uScreenSpaceY); |
439 pParticle->flt_5C = pEngine->pIndoorCameraD3D->fov_x; | 439 pParticle->flt_5C = pIndoorCameraD3D->fov_x; |
440 //v4 = pParticle->flt_5C; | 440 //v4 = pParticle->flt_5C; |
441 pParticle->flt_60 = pEngine->pIndoorCameraD3D->fov_y; | 441 pParticle->flt_60 = pIndoorCameraD3D->fov_y; |
442 //v5 = v4 + 6.7553994e15; | 442 //v5 = v4 + 6.7553994e15; |
443 LODWORD(v6) = 0; | 443 LODWORD(v6) = 0; |
444 HIDWORD(v6) = floorf(pParticle->flt_5C + 0.5f); | 444 HIDWORD(v6) = floorf(pParticle->flt_5C + 0.5f); |
445 //v7 = pParticle->flt_28; | 445 //v7 = pParticle->flt_28; |
446 //pParticle->_screenspace_scale = v6 / x; | 446 //pParticle->_screenspace_scale = v6 / x; |
470 int v40; // [sp+14h] [bp-3Ch]@12 | 470 int v40; // [sp+14h] [bp-3Ch]@12 |
471 int v44; // [sp+2Ch] [bp-24h]@1 | 471 int v44; // [sp+2Ch] [bp-24h]@1 |
472 int v45; // [sp+40h] [bp-10h]@5 | 472 int v45; // [sp+40h] [bp-10h]@5 |
473 int X_4; // [sp+48h] [bp-8h]@5 | 473 int X_4; // [sp+48h] [bp-8h]@5 |
474 | 474 |
475 v3 = stru_5C6E00->Cos(pEngine->pIndoorCameraD3D->sRotationX); | 475 v3 = stru_5C6E00->Cos(pIndoorCameraD3D->sRotationX); |
476 v44 = stru_5C6E00->Sin(pEngine->pIndoorCameraD3D->sRotationX); | 476 v44 = stru_5C6E00->Sin(pIndoorCameraD3D->sRotationX); |
477 v4 = stru_5C6E00->Cos(pEngine->pIndoorCameraD3D->sRotationY); | 477 v4 = stru_5C6E00->Cos(pIndoorCameraD3D->sRotationY); |
478 v5 = stru_5C6E00->Sin(pEngine->pIndoorCameraD3D->sRotationY); | 478 v5 = stru_5C6E00->Sin(pIndoorCameraD3D->sRotationY); |
479 | 479 |
480 if (pParticles[uID].type == ParticleType_Invalid) | 480 if (pParticles[uID].type == ParticleType_Invalid) |
481 return false; | 481 return false; |
482 | 482 |
483 if ( v3 ) | 483 if ( v3 ) |
484 { | 484 { |
485 if (pParticles[uID].type & ParticleType_Line) | 485 if (pParticles[uID].type & ParticleType_Line) |
486 { | 486 { |
487 v11 = fixpoint_sub_unknown(pParticles[uID].x - pEngine->pIndoorCameraD3D->vPartyPos.x, v4) | 487 v11 = fixpoint_sub_unknown(pParticles[uID].x - pIndoorCameraD3D->vPartyPos.x, v4) |
488 + fixpoint_sub_unknown(pParticles[uID].y - pEngine->pIndoorCameraD3D->vPartyPos.y, v5); | 488 + fixpoint_sub_unknown(pParticles[uID].y - pIndoorCameraD3D->vPartyPos.y, v5); |
489 long long _hidword_v12 = fixpoint_mul(v11, v3) + fixpoint_sub_unknown(pParticles[uID].z - pEngine->pIndoorCameraD3D->vPartyPos.z, v44); | 489 long long _hidword_v12 = fixpoint_mul(v11, v3) + fixpoint_sub_unknown(pParticles[uID].z - pIndoorCameraD3D->vPartyPos.z, v44); |
490 LODWORD(v13) = 0; | 490 LODWORD(v13) = 0; |
491 HIDWORD(v13) = SLOWORD(pODMRenderParams->int_fov_rad); | 491 HIDWORD(v13) = SLOWORD(pODMRenderParams->int_fov_rad); |
492 pParticles[uID]._screenspace_scale = v13 / _hidword_v12; | 492 pParticles[uID]._screenspace_scale = v13 / _hidword_v12; |
493 pParticles[uID].uScreenSpaceX = pViewport->uScreenCenterX | 493 pParticles[uID].uScreenSpaceX = pViewport->uScreenCenterX |
494 - ((signed int)fixpoint_mul(pParticles[uID]._screenspace_scale, (fixpoint_sub_unknown(pParticles[uID].y | 494 - ((signed int)fixpoint_mul(pParticles[uID]._screenspace_scale, (fixpoint_sub_unknown(pParticles[uID].y |
495 - pEngine->pIndoorCameraD3D->vPartyPos.y, v4) | 495 - pIndoorCameraD3D->vPartyPos.y, v4) |
496 - fixpoint_sub_unknown(pParticles[uID].x - pEngine->pIndoorCameraD3D->vPartyPos.x, v5))) >> 16); | 496 - fixpoint_sub_unknown(pParticles[uID].x - pIndoorCameraD3D->vPartyPos.x, v5))) >> 16); |
497 pParticles[uID].uScreenSpaceY = pViewport->uScreenCenterY | 497 pParticles[uID].uScreenSpaceY = pViewport->uScreenCenterY |
498 - ((signed int)fixpoint_mul(pParticles[uID]._screenspace_scale, (fixpoint_sub_unknown(pParticles[uID].z | 498 - ((signed int)fixpoint_mul(pParticles[uID]._screenspace_scale, (fixpoint_sub_unknown(pParticles[uID].z |
499 - pEngine->pIndoorCameraD3D->vPartyPos.z, v3) | 499 - pIndoorCameraD3D->vPartyPos.z, v3) |
500 - fixpoint_mul(v11, v44))) >> 16); | 500 - fixpoint_mul(v11, v44))) >> 16); |
501 pParticles[uID].sZValue = _hidword_v12; | 501 pParticles[uID].sZValue = _hidword_v12; |
502 } | 502 } |
503 v45 = fixpoint_sub_unknown(pParticles[uID].x - pEngine->pIndoorCameraD3D->vPartyPos.x, v4) + fixpoint_sub_unknown(pParticles[uID].y | 503 v45 = fixpoint_sub_unknown(pParticles[uID].x - pIndoorCameraD3D->vPartyPos.x, v4) + fixpoint_sub_unknown(pParticles[uID].y |
504 - pEngine->pIndoorCameraD3D->vPartyPos.y, v5); | 504 - pIndoorCameraD3D->vPartyPos.y, v5); |
505 X_4 = fixpoint_sub_unknown(pParticles[uID].z - pEngine->pIndoorCameraD3D->vPartyPos.z, v44) + fixpoint_mul(v45, v3); | 505 X_4 = fixpoint_sub_unknown(pParticles[uID].z - pIndoorCameraD3D->vPartyPos.z, v44) + fixpoint_mul(v45, v3); |
506 if ( X_4 < 0x40000 ) | 506 if ( X_4 < 0x40000 ) |
507 return 0; | 507 return 0; |
508 v16 = fixpoint_sub_unknown(pParticles[uID].y - pEngine->pIndoorCameraD3D->vPartyPos.y, v4) | 508 v16 = fixpoint_sub_unknown(pParticles[uID].y - pIndoorCameraD3D->vPartyPos.y, v4) |
509 - fixpoint_sub_unknown(pParticles[uID].x - pEngine->pIndoorCameraD3D->vPartyPos.x, v5); | 509 - fixpoint_sub_unknown(pParticles[uID].x - pIndoorCameraD3D->vPartyPos.x, v5); |
510 v17 = fixpoint_sub_unknown(pParticles[uID].z - pEngine->pIndoorCameraD3D->vPartyPos.z, v3) - fixpoint_mul(v45, v44); | 510 v17 = fixpoint_sub_unknown(pParticles[uID].z - pIndoorCameraD3D->vPartyPos.z, v3) - fixpoint_mul(v45, v44); |
511 } | 511 } |
512 else | 512 else |
513 { | 513 { |
514 if (pParticles[uID].type & ParticleType_Line) | 514 if (pParticles[uID].type & ParticleType_Line) |
515 { | 515 { |
516 LODWORD(v22) = 0; | 516 LODWORD(v22) = 0; |
517 HIDWORD(v22) = SLOWORD(pODMRenderParams->int_fov_rad); | 517 HIDWORD(v22) = SLOWORD(pODMRenderParams->int_fov_rad); |
518 long long _var_123 = fixpoint_sub_unknown(pParticles[uID].x - pEngine->pIndoorCameraD3D->vPartyPos.x, v4) | 518 long long _var_123 = fixpoint_sub_unknown(pParticles[uID].x - pIndoorCameraD3D->vPartyPos.x, v4) |
519 + fixpoint_sub_unknown(pParticles[uID].y - pEngine->pIndoorCameraD3D->vPartyPos.y, v5); | 519 + fixpoint_sub_unknown(pParticles[uID].y - pIndoorCameraD3D->vPartyPos.y, v5); |
520 pParticles[uID]._screenspace_scale = v22 / _var_123; | 520 pParticles[uID]._screenspace_scale = v22 / _var_123; |
521 pParticles[uID].uScreenSpaceX = pViewport->uScreenCenterX | 521 pParticles[uID].uScreenSpaceX = pViewport->uScreenCenterX |
522 - ((signed int)fixpoint_mul(pParticles[uID]._screenspace_scale, (fixpoint_sub_unknown(pParticles[uID].y | 522 - ((signed int)fixpoint_mul(pParticles[uID]._screenspace_scale, (fixpoint_sub_unknown(pParticles[uID].y |
523 - pEngine->pIndoorCameraD3D->vPartyPos.y, v4) | 523 - pIndoorCameraD3D->vPartyPos.y, v4) |
524 - fixpoint_sub_unknown(pParticles[uID].x - pEngine->pIndoorCameraD3D->vPartyPos.x, v5))) >> 16); | 524 - fixpoint_sub_unknown(pParticles[uID].x - pIndoorCameraD3D->vPartyPos.x, v5))) >> 16); |
525 pParticles[uID].uScreenSpaceY = pViewport->uScreenCenterY - (fixpoint_sub_unknown(pParticles[uID].z, pParticles[uID]._screenspace_scale) >> 16); | 525 pParticles[uID].uScreenSpaceY = pViewport->uScreenCenterY - (fixpoint_sub_unknown(pParticles[uID].z, pParticles[uID]._screenspace_scale) >> 16); |
526 pParticles[uID].sZValue = _var_123; | 526 pParticles[uID].sZValue = _var_123; |
527 } | 527 } |
528 v26 = fixpoint_sub_unknown(pParticles[uID].y - pEngine->pIndoorCameraD3D->vPartyPos.y, v5); | 528 v26 = fixpoint_sub_unknown(pParticles[uID].y - pIndoorCameraD3D->vPartyPos.y, v5); |
529 X_4 = v26 + fixpoint_sub_unknown(pParticles[uID].x - pEngine->pIndoorCameraD3D->vPartyPos.x, v4); | 529 X_4 = v26 + fixpoint_sub_unknown(pParticles[uID].x - pIndoorCameraD3D->vPartyPos.x, v4); |
530 if ( X_4 < 0x40000 || X_4 > (pODMRenderParams->uPickDepth - 1000) << 16 ) | 530 if ( X_4 < 0x40000 || X_4 > (pODMRenderParams->uPickDepth - 1000) << 16 ) |
531 return 0; | 531 return 0; |
532 v17 = pParticles[uID].z; | 532 v17 = pParticles[uID].z; |
533 v16 = fixpoint_sub_unknown(pParticles[uID].y - pEngine->pIndoorCameraD3D->vPartyPos.y, v4) | 533 v16 = fixpoint_sub_unknown(pParticles[uID].y - pIndoorCameraD3D->vPartyPos.y, v4) |
534 - fixpoint_sub_unknown(pParticles[uID].x - pEngine->pIndoorCameraD3D->vPartyPos.x, v5); | 534 - fixpoint_sub_unknown(pParticles[uID].x - pIndoorCameraD3D->vPartyPos.x, v5); |
535 } | 535 } |
536 v40 = v17; | 536 v40 = v17; |
537 v28 = abs(v16); | 537 v28 = abs(v16); |
538 if ( abs(X_4) >= v28 ) | 538 if ( abs(X_4) >= v28 ) |
539 { | 539 { |