Mercurial > mm7
diff ParticleEngine.cpp @ 1643:7182930263b3
fixpoint functions renaming
author | zipi |
---|---|
date | Tue, 17 Sep 2013 19:24:23 +0100 |
parents | 8971dc85b8fb |
children | c1c74df0a33e |
line wrap: on
line diff
--- a/ParticleEngine.cpp Tue Sep 17 20:15:56 2013 +0200 +++ b/ParticleEngine.cpp Tue Sep 17 19:24:23 2013 +0100 @@ -415,7 +415,7 @@ //uParticleID = v44 >> 16; LODWORD(v44) = (signed int)(v44 >> 16) >> 16; pParticle->uScreenSpaceY = pBLVRenderParams->uViewportCenterY - v44; - pParticle->_screenspace_scale = fixpoint_sub0(fixpoint_from_float(pParticle->flt_28), pParticle->_screenspace_scale); + pParticle->_screenspace_scale = fixpoint_mul(fixpoint_from_float(pParticle->flt_28), pParticle->_screenspace_scale); pParticle->sZValue = z; return true; } @@ -442,7 +442,7 @@ //v7 = pParticle->flt_28; //pParticle->_screenspace_scale = v6 / x; //v8 = v7; - pParticle->_screenspace_scale = fixpoint_sub0(fixpoint_from_float(pParticle->flt_28), v6 / x); + pParticle->_screenspace_scale = fixpoint_mul(fixpoint_from_float(pParticle->flt_28), v6 / x); pParticle->sZValue = x; return true; } @@ -527,11 +527,11 @@ //uIDc = (LODWORD(v8) - pIndoorCamera->pos.x) << 16; //v9 = v6->_y + 6.7553994e15; //v10 = (LODWORD(v9) - pIndoorCamera->pos.y) << 16; - v11 = fixpoint_mul(v6->x - pGame->pIndoorCameraD3D->vPartyPos.x, v4) + fixpoint_mul(v6->y - pGame->pIndoorCameraD3D->vPartyPos.y, v5); - //HIDWORD(v8) = fixpoint_mul(v6->x - pIndoorCamera->pos.x, v5); + v11 = fixpoint_sub_unknown(v6->x - pGame->pIndoorCameraD3D->vPartyPos.x, v4) + fixpoint_sub_unknown(v6->y - pGame->pIndoorCameraD3D->vPartyPos.y, v5); + //HIDWORD(v8) = fixpoint_sub_unknown(v6->x - pIndoorCamera->pos.x, v5); //v12 = v6->_z + 6.7553994e15; //uIDd = (LODWORD(v12) - pIndoorCamera->pos.z) << 16; - auto _hidword_v12 = fixpoint_sub0(v11, v3) + fixpoint_mul(v6->z - pGame->pIndoorCameraD3D->vPartyPos.z, v44); + auto _hidword_v12 = fixpoint_mul(v11, v3) + fixpoint_sub_unknown(v6->z - pGame->pIndoorCameraD3D->vPartyPos.z, v44); LODWORD(v13) = 0; HIDWORD(v13) = SLOWORD(pODMRenderParams->int_fov_rad); //v14 = v13 / _hidword_v12; @@ -539,24 +539,24 @@ //v15 = v6->_screenspace_scale; v6->uScreenSpaceX = pViewport->uScreenCenterX - ((signed int)((unsigned __int64)(v6->_screenspace_scale - * (signed __int64)(fixpoint_mul(v6->y - pGame->pIndoorCameraD3D->vPartyPos.y, v4) - - fixpoint_mul(v6->x - pGame->pIndoorCameraD3D->vPartyPos.x, v5))) >> 16) >> 16); + * (signed __int64)(fixpoint_sub_unknown(v6->y - pGame->pIndoorCameraD3D->vPartyPos.y, v4) + - fixpoint_sub_unknown(v6->x - pGame->pIndoorCameraD3D->vPartyPos.x, v5))) >> 16) >> 16); v6->uScreenSpaceY = pViewport->uScreenCenterY - ((signed int)((unsigned __int64)(v6->_screenspace_scale - * (signed __int64)(fixpoint_mul(v6->z - pGame->pIndoorCameraD3D->vPartyPos.z, v3) + * (signed __int64)(fixpoint_sub_unknown(v6->z - pGame->pIndoorCameraD3D->vPartyPos.z, v3) - ((unsigned __int64)(v11 * (signed __int64)v44) >> 16))) >> 16) >> 16); v6->sZValue = _hidword_v12; } //uIDe = (v41 - pIndoorCamera->pos.x) << 16; //v47 = (LODWORD(v39) - pIndoorCamera->pos.y) << 16; - v45 = fixpoint_mul(v6->x - pGame->pIndoorCameraD3D->vPartyPos.x, v4) + fixpoint_mul(v6->y - pGame->pIndoorCameraD3D->vPartyPos.y, v5); - //HIDWORD(v42) = fixpoint_mul(v6->x - pIndoorCamera->pos.x, v5); + v45 = fixpoint_sub_unknown(v6->x - pGame->pIndoorCameraD3D->vPartyPos.x, v4) + fixpoint_sub_unknown(v6->y - pGame->pIndoorCameraD3D->vPartyPos.y, v5); + //HIDWORD(v42) = fixpoint_sub_unknown(v6->x - pIndoorCamera->pos.x, v5); //uIDa = (LODWORD(v42) - pIndoorCamera->pos.z) << 16; - X_4 = fixpoint_mul(v6->z - pGame->pIndoorCameraD3D->vPartyPos.z, v44) + fixpoint_sub0(v45, v3); + X_4 = fixpoint_sub_unknown(v6->z - pGame->pIndoorCameraD3D->vPartyPos.z, v44) + fixpoint_mul(v45, v3); if ( X_4 < 0x40000 ) return 0; - v16 = fixpoint_mul(v6->y - pGame->pIndoorCameraD3D->vPartyPos.y, v4) - fixpoint_mul(v6->x - pGame->pIndoorCameraD3D->vPartyPos.x, v5); - v17 = fixpoint_mul(v6->z - pGame->pIndoorCameraD3D->vPartyPos.z, v3) - fixpoint_sub0(v45, v44); + v16 = fixpoint_sub_unknown(v6->y - pGame->pIndoorCameraD3D->vPartyPos.y, v4) - fixpoint_sub_unknown(v6->x - pGame->pIndoorCameraD3D->vPartyPos.x, v5); + v17 = fixpoint_sub_unknown(v6->z - pGame->pIndoorCameraD3D->vPartyPos.z, v3) - fixpoint_mul(v45, v44); } else { @@ -569,26 +569,26 @@ //v21 = v6->_z + 6.7553994e15; LODWORD(v22) = 0; HIDWORD(v22) = SLOWORD(pODMRenderParams->int_fov_rad); - auto _var_123 = fixpoint_mul(v6->x - pGame->pIndoorCameraD3D->vPartyPos.x, v4) + fixpoint_mul(v6->y - pGame->pIndoorCameraD3D->vPartyPos.y, v5); + auto _var_123 = fixpoint_sub_unknown(v6->x - pGame->pIndoorCameraD3D->vPartyPos.x, v4) + fixpoint_sub_unknown(v6->y - pGame->pIndoorCameraD3D->vPartyPos.y, v5); //v23 = v22 / _var_123; v6->_screenspace_scale = v22 / _var_123; //v24 = v6->_screenspace_scale; v6->uScreenSpaceX = pViewport->uScreenCenterX - ((signed int)((unsigned __int64)(v6->_screenspace_scale - * (signed __int64)(fixpoint_mul(v6->y - pGame->pIndoorCameraD3D->vPartyPos.y, v4) - - fixpoint_mul(v6->x - pGame->pIndoorCameraD3D->vPartyPos.x, v5))) >> 16) >> 16); - v6->uScreenSpaceY = pViewport->uScreenCenterY - (fixpoint_mul(v6->z, v6->_screenspace_scale) >> 16); + * (signed __int64)(fixpoint_sub_unknown(v6->y - pGame->pIndoorCameraD3D->vPartyPos.y, v4) + - fixpoint_sub_unknown(v6->x - pGame->pIndoorCameraD3D->vPartyPos.x, v5))) >> 16) >> 16); + v6->uScreenSpaceY = pViewport->uScreenCenterY - (fixpoint_sub_unknown(v6->z, v6->_screenspace_scale) >> 16); v6->sZValue = _var_123; } //uIDb = (v41 - pIndoorCamera->pos.x) << 16; //v48 = (LODWORD(v39) - pIndoorCamera->pos.y) << 16; - v26 = fixpoint_mul(v6->y - pGame->pIndoorCameraD3D->vPartyPos.y, v5); + v26 = fixpoint_sub_unknown(v6->y - pGame->pIndoorCameraD3D->vPartyPos.y, v5); //v27 = v26 + ((unsigned __int64)(uIDb * (signed __int64)v4) >> 16); - X_4 = v26 + fixpoint_mul(v6->x - pGame->pIndoorCameraD3D->vPartyPos.x, v4); + X_4 = v26 + fixpoint_sub_unknown(v6->x - pGame->pIndoorCameraD3D->vPartyPos.x, v4); if ( X_4 < 0x40000 || X_4 > (pODMRenderParams->uPickDepth - 1000) << 16 ) return 0; v17 = v6->z; - v16 = fixpoint_mul(v6->y - pGame->pIndoorCameraD3D->vPartyPos.y, v4) - fixpoint_mul(v6->x - pGame->pIndoorCameraD3D->vPartyPos.x, v5); + v16 = fixpoint_sub_unknown(v6->y - pGame->pIndoorCameraD3D->vPartyPos.y, v4) - fixpoint_sub_unknown(v6->x - pGame->pIndoorCameraD3D->vPartyPos.x, v5); } v40 = v17; v28 = abs(v16); @@ -604,7 +604,7 @@ v33 = (signed int)((unsigned __int64)(v6->_screenspace_scale * (signed __int64)v40) >> 16) >> 16; //v34 = pViewport->uScreenCenterY - v33; v6->uScreenSpaceY = pViewport->uScreenCenterY - v33; - v6->_screenspace_scale = fixpoint_sub0(fixpoint_from_float(v6->flt_28), v6->_screenspace_scale); + v6->_screenspace_scale = fixpoint_mul(fixpoint_from_float(v6->flt_28), v6->_screenspace_scale); v6->sZValue = X_4; v36 = v6->uScreenSpaceX; if ( v36 >= (signed int)pViewport->uViewportTL_X )