Mercurial > mm7
diff Engine/Graphics/ParticleEngine.cpp @ 2543:b6140dfeac27
GameOver h/cpp
author | a.parshin |
---|---|
date | Sun, 10 May 2015 03:21:14 +0200 |
parents | a902abdfc7f2 |
children |
line wrap: on
line diff
--- a/Engine/Graphics/ParticleEngine.cpp Sun May 10 02:04:52 2015 +0200 +++ b/Engine/Graphics/ParticleEngine.cpp Sun May 10 03:21:14 2015 +0200 @@ -308,7 +308,7 @@ z_int_ = floorf(pParticle->z + 0.5f); /*if ( !pRenderer->pRenderD3D ) { - if (pEngine->pIndoorCameraD3D->sRotationX) + if (pIndoorCameraD3D->sRotationX) { if (pParticle->type & ParticleType_Line) { @@ -316,22 +316,22 @@ int _uParticleID = (int)(floorf(pParticle->_x + 0.5f) - pBLVRenderParams->vPartyPos.x) << 16; //v12 = pParticle->_y + 6.7553994e15; y = (int)(floorf(pParticle->_y + 0.5f) - pBLVRenderParams->vPartyPos.y) << 16; - z = (unsigned __int64)(y * (signed __int64)pEngine->pIndoorCameraD3D->int_sine_y) >> 16; - HIDWORD(a5) = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_y) >> 16) + z = (unsigned __int64)(y * (signed __int64)pIndoorCameraD3D->int_sine_y) >> 16; + HIDWORD(a5) = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_cosine_y) >> 16) - z; - a6 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_sine_y) >> 16; + a6 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_sine_y) >> 16; //v13 = pParticle->_z + 6.7553994e15; _uParticleID = (int)(floorf(pParticle->_z + 0.5f) - pBLVRenderParams->vPartyPos.z) << 16; - z = ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_x) >> 16) - - ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_sine_x) >> 16); + z = ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pIndoorCameraD3D->int_cosine_x) >> 16) + - ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_sine_x) >> 16); v14 = z; - HIDWORD(v13) = (unsigned __int64)(SHIDWORD(a5) * (signed __int64)pEngine->pIndoorCameraD3D->int_sine_x) >> 16; - HIDWORD(a5) = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_x) >> 16; + HIDWORD(v13) = (unsigned __int64)(SHIDWORD(a5) * (signed __int64)pIndoorCameraD3D->int_sine_x) >> 16; + HIDWORD(a5) = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_cosine_x) >> 16; //LODWORD(v15) = pBLVRenderParams->field_40 << 16; //HIDWORD(v15) = pBLVRenderParams->field_40 >> 16; //v16 = v15 / z; v16 = fixpoint_div(pBLVRenderParams->field_40, z); - v17 = (unsigned __int64)(y * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_y) >> 16; + v17 = (unsigned __int64)(y * (signed __int64)pIndoorCameraD3D->int_cosine_y) >> 16; pParticle->_screenspace_scale = v16; _uParticleID = (unsigned __int64)(v16 * (signed __int64)(a6 + v17)) >> 16; LODWORD(v18) = pBLVRenderParams->uViewportCenterX @@ -346,20 +346,20 @@ } int _uParticleID = (x_int - pBLVRenderParams->vPartyPos.x) << 16; y = (y_int_ - pBLVRenderParams->vPartyPos.y) << 16; - HIDWORD(a5) = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_y) >> 16) - - ((unsigned __int64)(y * (signed __int64)pEngine->pIndoorCameraD3D->int_sine_y) >> 16); - a6 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_sine_y) >> 16; - z_int_4 = (unsigned __int64)(y * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_y) >> 16; + HIDWORD(a5) = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_cosine_y) >> 16) + - ((unsigned __int64)(y * (signed __int64)pIndoorCameraD3D->int_sine_y) >> 16); + a6 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_sine_y) >> 16; + z_int_4 = (unsigned __int64)(y * (signed __int64)pIndoorCameraD3D->int_cosine_y) >> 16; _uParticleID = (z_int_ - pBLVRenderParams->vPartyPos.z) << 16; - v21 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_sine_x) >> 16; - v22 = ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_x) >> 16) - v21; - z = ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_x) >> 16) - v21; + v21 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_sine_x) >> 16; + v22 = ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pIndoorCameraD3D->int_cosine_x) >> 16) - v21; + z = ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pIndoorCameraD3D->int_cosine_x) >> 16) - v21; if ( v22 < (signed int)0x40000u || v22 > (signed int)0x1F400000u ) return 0; v23 = a6 + z_int_4; a2 = a6 + z_int_4; - v24 = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_x) >> 16) - + ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pEngine->pIndoorCameraD3D->int_sine_x) >> 16); + v24 = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_cosine_x) >> 16) + + ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pIndoorCameraD3D->int_sine_x) >> 16); } else { @@ -369,17 +369,17 @@ int _uParticleID = ((int)floorf(pParticle->_x + 0.5f) - pBLVRenderParams->vPartyPos.x) << 16; //v26 = pParticle->_y + 6.7553994e15; y = ((int)floorf(pParticle->_y + 0.5f) - pBLVRenderParams->vPartyPos.y) << 16; - auto _hiword_v25 = (__int64)(y * (signed __int64)pEngine->pIndoorCameraD3D->int_sine_y) >> 16; - v27 = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_y) >> 16) - _hiword_v25; - z = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_y) >> 16) - _hiword_v25; - v28 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_sine_y) >> 16; + auto _hiword_v25 = (__int64)(y * (signed __int64)pIndoorCameraD3D->int_sine_y) >> 16; + v27 = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_cosine_y) >> 16) - _hiword_v25; + z = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_cosine_y) >> 16) - _hiword_v25; + v28 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_sine_y) >> 16; //a5 = pParticle->_z + 6.7553994e15; v29 = ((int)floorf(pParticle->_z + 0.5f) - pBLVRenderParams->vPartyPos.z) << 16; //LODWORD(v30) = pBLVRenderParams->field_40 << 16; //HIDWORD(v30) = pBLVRenderParams->field_40 >> 16; //v31 = v30 / z; v31 = fixpoint_div(pBLVRenderParams->field_40, z); - v32 = (unsigned __int64)(y * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_y) >> 16; + v32 = (unsigned __int64)(y * (signed __int64)pIndoorCameraD3D->int_cosine_y) >> 16; pParticle->_screenspace_scale = v31; _uParticleID = (unsigned __int64)(v31 * (signed __int64)(v28 + v32)) >> 16; LODWORD(v33) = pBLVRenderParams->uViewportCenterX - ((signed int)((unsigned __int64)(v31 * (signed __int64)(v28 + v32)) >> 16) >> 16); @@ -391,15 +391,15 @@ } int _uParticleID = (x_int - pBLVRenderParams->vPartyPos.x) << 16; y = (y_int_ - pBLVRenderParams->vPartyPos.y) << 16; - v36 = (unsigned __int64)(y * (signed __int64)pEngine->pIndoorCameraD3D->int_sine_y) >> 16; - v22 = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_y) >> 16) - v36; - z = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_y) >> 16) - v36; + v36 = (unsigned __int64)(y * (signed __int64)pIndoorCameraD3D->int_sine_y) >> 16; + v22 = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_cosine_y) >> 16) - v36; + z = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_cosine_y) >> 16) - v36; if ( v22 < 262144 || v22 > 524288000 ) return 0; - v37 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pEngine->pIndoorCameraD3D->int_sine_y) >> 16; - _uParticleID = (unsigned __int64)(y * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_y) >> 16; - v23 = v37 + ((unsigned __int64)(y * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_y) >> 16); - a2 = v37 + ((unsigned __int64)(y * (signed __int64)pEngine->pIndoorCameraD3D->int_cosine_y) >> 16); + v37 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pIndoorCameraD3D->int_sine_y) >> 16; + _uParticleID = (unsigned __int64)(y * (signed __int64)pIndoorCameraD3D->int_cosine_y) >> 16; + v23 = v37 + ((unsigned __int64)(y * (signed __int64)pIndoorCameraD3D->int_cosine_y) >> 16); + a2 = v37 + ((unsigned __int64)(y * (signed __int64)pIndoorCameraD3D->int_cosine_y) >> 16); v24 = (z_int_ - pBLVRenderParams->vPartyPos.z) << 16; } int _uParticleID = abs(v23); @@ -426,7 +426,7 @@ }*/ int x; - if ( !pEngine->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible_BLV( + if ( !pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible_BLV( x_int, y_int_, z_int_, @@ -435,10 +435,10 @@ &z, 1) ) return false; - pEngine->pIndoorCameraD3D->Project(x, y, z, &pParticle->uScreenSpaceX, &pParticle->uScreenSpaceY); - pParticle->flt_5C = pEngine->pIndoorCameraD3D->fov_x; + pIndoorCameraD3D->Project(x, y, z, &pParticle->uScreenSpaceX, &pParticle->uScreenSpaceY); + pParticle->flt_5C = pIndoorCameraD3D->fov_x; //v4 = pParticle->flt_5C; - pParticle->flt_60 = pEngine->pIndoorCameraD3D->fov_y; + pParticle->flt_60 = pIndoorCameraD3D->fov_y; //v5 = v4 + 6.7553994e15; LODWORD(v6) = 0; HIDWORD(v6) = floorf(pParticle->flt_5C + 0.5f); @@ -472,10 +472,10 @@ int v45; // [sp+40h] [bp-10h]@5 int X_4; // [sp+48h] [bp-8h]@5 - v3 = stru_5C6E00->Cos(pEngine->pIndoorCameraD3D->sRotationX); - v44 = stru_5C6E00->Sin(pEngine->pIndoorCameraD3D->sRotationX); - v4 = stru_5C6E00->Cos(pEngine->pIndoorCameraD3D->sRotationY); - v5 = stru_5C6E00->Sin(pEngine->pIndoorCameraD3D->sRotationY); + v3 = stru_5C6E00->Cos(pIndoorCameraD3D->sRotationX); + v44 = stru_5C6E00->Sin(pIndoorCameraD3D->sRotationX); + v4 = stru_5C6E00->Cos(pIndoorCameraD3D->sRotationY); + v5 = stru_5C6E00->Sin(pIndoorCameraD3D->sRotationY); if (pParticles[uID].type == ParticleType_Invalid) return false; @@ -484,30 +484,30 @@ { if (pParticles[uID].type & ParticleType_Line) { - v11 = fixpoint_sub_unknown(pParticles[uID].x - pEngine->pIndoorCameraD3D->vPartyPos.x, v4) - + fixpoint_sub_unknown(pParticles[uID].y - pEngine->pIndoorCameraD3D->vPartyPos.y, v5); - long long _hidword_v12 = fixpoint_mul(v11, v3) + fixpoint_sub_unknown(pParticles[uID].z - pEngine->pIndoorCameraD3D->vPartyPos.z, v44); + v11 = fixpoint_sub_unknown(pParticles[uID].x - pIndoorCameraD3D->vPartyPos.x, v4) + + fixpoint_sub_unknown(pParticles[uID].y - pIndoorCameraD3D->vPartyPos.y, v5); + long long _hidword_v12 = fixpoint_mul(v11, v3) + fixpoint_sub_unknown(pParticles[uID].z - pIndoorCameraD3D->vPartyPos.z, v44); LODWORD(v13) = 0; HIDWORD(v13) = SLOWORD(pODMRenderParams->int_fov_rad); pParticles[uID]._screenspace_scale = v13 / _hidword_v12; pParticles[uID].uScreenSpaceX = pViewport->uScreenCenterX - ((signed int)fixpoint_mul(pParticles[uID]._screenspace_scale, (fixpoint_sub_unknown(pParticles[uID].y - - pEngine->pIndoorCameraD3D->vPartyPos.y, v4) - - fixpoint_sub_unknown(pParticles[uID].x - pEngine->pIndoorCameraD3D->vPartyPos.x, v5))) >> 16); + - pIndoorCameraD3D->vPartyPos.y, v4) + - fixpoint_sub_unknown(pParticles[uID].x - pIndoorCameraD3D->vPartyPos.x, v5))) >> 16); pParticles[uID].uScreenSpaceY = pViewport->uScreenCenterY - ((signed int)fixpoint_mul(pParticles[uID]._screenspace_scale, (fixpoint_sub_unknown(pParticles[uID].z - - pEngine->pIndoorCameraD3D->vPartyPos.z, v3) + - pIndoorCameraD3D->vPartyPos.z, v3) - fixpoint_mul(v11, v44))) >> 16); pParticles[uID].sZValue = _hidword_v12; } - v45 = fixpoint_sub_unknown(pParticles[uID].x - pEngine->pIndoorCameraD3D->vPartyPos.x, v4) + fixpoint_sub_unknown(pParticles[uID].y - - pEngine->pIndoorCameraD3D->vPartyPos.y, v5); - X_4 = fixpoint_sub_unknown(pParticles[uID].z - pEngine->pIndoorCameraD3D->vPartyPos.z, v44) + fixpoint_mul(v45, v3); + v45 = fixpoint_sub_unknown(pParticles[uID].x - pIndoorCameraD3D->vPartyPos.x, v4) + fixpoint_sub_unknown(pParticles[uID].y + - pIndoorCameraD3D->vPartyPos.y, v5); + X_4 = fixpoint_sub_unknown(pParticles[uID].z - pIndoorCameraD3D->vPartyPos.z, v44) + fixpoint_mul(v45, v3); if ( X_4 < 0x40000 ) return 0; - v16 = fixpoint_sub_unknown(pParticles[uID].y - pEngine->pIndoorCameraD3D->vPartyPos.y, v4) - - fixpoint_sub_unknown(pParticles[uID].x - pEngine->pIndoorCameraD3D->vPartyPos.x, v5); - v17 = fixpoint_sub_unknown(pParticles[uID].z - pEngine->pIndoorCameraD3D->vPartyPos.z, v3) - fixpoint_mul(v45, v44); + v16 = fixpoint_sub_unknown(pParticles[uID].y - pIndoorCameraD3D->vPartyPos.y, v4) + - fixpoint_sub_unknown(pParticles[uID].x - pIndoorCameraD3D->vPartyPos.x, v5); + v17 = fixpoint_sub_unknown(pParticles[uID].z - pIndoorCameraD3D->vPartyPos.z, v3) - fixpoint_mul(v45, v44); } else { @@ -515,23 +515,23 @@ { LODWORD(v22) = 0; HIDWORD(v22) = SLOWORD(pODMRenderParams->int_fov_rad); - long long _var_123 = fixpoint_sub_unknown(pParticles[uID].x - pEngine->pIndoorCameraD3D->vPartyPos.x, v4) - + fixpoint_sub_unknown(pParticles[uID].y - pEngine->pIndoorCameraD3D->vPartyPos.y, v5); + long long _var_123 = fixpoint_sub_unknown(pParticles[uID].x - pIndoorCameraD3D->vPartyPos.x, v4) + + fixpoint_sub_unknown(pParticles[uID].y - pIndoorCameraD3D->vPartyPos.y, v5); pParticles[uID]._screenspace_scale = v22 / _var_123; pParticles[uID].uScreenSpaceX = pViewport->uScreenCenterX - ((signed int)fixpoint_mul(pParticles[uID]._screenspace_scale, (fixpoint_sub_unknown(pParticles[uID].y - - pEngine->pIndoorCameraD3D->vPartyPos.y, v4) - - fixpoint_sub_unknown(pParticles[uID].x - pEngine->pIndoorCameraD3D->vPartyPos.x, v5))) >> 16); + - pIndoorCameraD3D->vPartyPos.y, v4) + - fixpoint_sub_unknown(pParticles[uID].x - pIndoorCameraD3D->vPartyPos.x, v5))) >> 16); pParticles[uID].uScreenSpaceY = pViewport->uScreenCenterY - (fixpoint_sub_unknown(pParticles[uID].z, pParticles[uID]._screenspace_scale) >> 16); pParticles[uID].sZValue = _var_123; } - v26 = fixpoint_sub_unknown(pParticles[uID].y - pEngine->pIndoorCameraD3D->vPartyPos.y, v5); - X_4 = v26 + fixpoint_sub_unknown(pParticles[uID].x - pEngine->pIndoorCameraD3D->vPartyPos.x, v4); + v26 = fixpoint_sub_unknown(pParticles[uID].y - pIndoorCameraD3D->vPartyPos.y, v5); + X_4 = v26 + fixpoint_sub_unknown(pParticles[uID].x - pIndoorCameraD3D->vPartyPos.x, v4); if ( X_4 < 0x40000 || X_4 > (pODMRenderParams->uPickDepth - 1000) << 16 ) return 0; v17 = pParticles[uID].z; - v16 = fixpoint_sub_unknown(pParticles[uID].y - pEngine->pIndoorCameraD3D->vPartyPos.y, v4) - - fixpoint_sub_unknown(pParticles[uID].x - pEngine->pIndoorCameraD3D->vPartyPos.x, v5); + v16 = fixpoint_sub_unknown(pParticles[uID].y - pIndoorCameraD3D->vPartyPos.y, v4) + - fixpoint_sub_unknown(pParticles[uID].x - pIndoorCameraD3D->vPartyPos.x, v5); } v40 = v17; v28 = abs(v16);