comparison IndoorCameraD3D.cpp @ 1642:8971dc85b8fb

More camera unifications.
author Nomad
date Tue, 17 Sep 2013 20:15:56 +0200
parents 466c5e15f524
children c1c74df0a33e
comparison
equal deleted inserted replaced
1641:466c5e15f524 1642:8971dc85b8fb
158 if (pGame->pIndoorCameraD3D->sRotationX) 158 if (pGame->pIndoorCameraD3D->sRotationX)
159 { 159 {
160 to_z = (z - pGame->pIndoorCameraD3D->vPartyPos.z) << 16; 160 to_z = (z - pGame->pIndoorCameraD3D->vPartyPos.z) << 16;
161 //if ( pRenderer->pRenderD3D ) 161 //if ( pRenderer->pRenderD3D )
162 //{ 162 //{
163 v14 = (unsigned __int64)(to_x * (signed __int64)pBLVRenderParams->sCosineY) 163 v14 = (unsigned __int64)(to_x * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y)
164 + (unsigned __int64)(to_y * (signed __int64)pBLVRenderParams->sSineY); 164 + (unsigned __int64)(to_y * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y);
165 v9 = (unsigned __int64)(to_x * (signed __int64)pBLVRenderParams->sSineY) 165 v9 = (unsigned __int64)(to_x * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y)
166 - (unsigned __int64)(to_y * (signed __int64)pBLVRenderParams->sCosineY); 166 - (unsigned __int64)(to_y * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y);
167 //} 167 //}
168 a3a = (z - pGame->pIndoorCameraD3D->vPartyPos.z) << 16; 168 a3a = (z - pGame->pIndoorCameraD3D->vPartyPos.z) << 16;
169 a2b = (unsigned __int64)(to_z * (signed __int64)pBLVRenderParams->sSineNegX) >> 16; 169 a2b = (unsigned __int64)(to_z * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16;
170 //v10 = pOutX; 170 //v10 = pOutX;
171 *pOutX = ((unsigned __int64)(v14 * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16) - a2b; 171 *pOutX = ((unsigned __int64)(v14 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16) - a2b;
172 *pOutZ = v9; 172 *pOutZ = v9;
173 *pOutY = ((unsigned __int64)(v14 * (signed __int64)pBLVRenderParams->sSineNegX) >> 16) 173 *pOutY = ((unsigned __int64)(v14 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16)
174 + ((unsigned __int64)(a3a * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16); 174 + ((unsigned __int64)(a3a * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16);
175 } 175 }
176 else 176 else
177 { 177 {
178 *pOutY = (z - pGame->pIndoorCameraD3D->vPartyPos.z) << 16; 178 *pOutY = (z - pGame->pIndoorCameraD3D->vPartyPos.z) << 16;
179 //if ( pRenderer->pRenderD3D ) 179 //if ( pRenderer->pRenderD3D )
180 //{ 180 //{
181 //v10 = pOutX; 181 //v10 = pOutX;
182 *pOutX = (unsigned __int64)(to_x * (signed __int64)pBLVRenderParams->sCosineY) 182 *pOutX = (unsigned __int64)(to_x * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y)
183 + (unsigned __int64)(to_y * (signed __int64)pBLVRenderParams->sSineY); 183 + (unsigned __int64)(to_y * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y);
184 *pOutZ = (unsigned __int64)(to_x * (signed __int64)pBLVRenderParams->sSineY) 184 *pOutZ = (unsigned __int64)(to_x * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y)
185 - (unsigned __int64)(to_y * (signed __int64)pBLVRenderParams->sCosineY); 185 - (unsigned __int64)(to_y * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y);
186 //} 186 //}
187 } 187 }
188 if (!bDoNotShow) 188 if (!bDoNotShow)
189 return false; 189 return false;
190 190
1607 } 1607 }
1608 while ( v3 ); 1608 while ( v3 );
1609 } 1609 }
1610 return result; 1610 return result;
1611 } 1611 }
1612
1613
1614
1615 // -- new
1616 // merged from IndoorCamera::Initialize2
1617 // and ODMRenderParams::RotationToInts
1618 // and BLVRenderParams::Reset
1619 void IndoorCameraD3D::CalculateRotations(int camera_rot_x, int camera_rot_y)
1620 {
1621 sRotationX = camera_rot_x;
1622 sRotationY = camera_rot_y;
1623
1624 fRotationYSine = sin((3.141592653589793 + 3.141592653589793) * (double)sRotationY / 2048.0);
1625 fRotationYCosine = cos((3.141592653589793 + 3.141592653589793) * (double)sRotationY / 2048.0);
1626 if (byte_4D864C && pGame->uFlags & 0x80 || uCurrentlyLoadedLevelType == LEVEL_Indoor)
1627 {
1628 fRotationXSine = sin((3.141592653589793 + 3.141592653589793) * (double)-sRotationX / 2048.0);
1629 fRotationXCosine = cos((3.141592653589793 + 3.141592653589793) * (double)-sRotationX / 2048.0);
1630
1631 int_sine_y = stru_5C6E00->Sin( pGame->pIndoorCameraD3D->sRotationY);
1632 int_cosine_y = stru_5C6E00->Cos( pGame->pIndoorCameraD3D->sRotationY);
1633 int_sine_x = stru_5C6E00->Sin(-pGame->pIndoorCameraD3D->sRotationX);
1634 int_cosine_x = stru_5C6E00->Cos(-pGame->pIndoorCameraD3D->sRotationX);
1635 }
1636 else
1637 {
1638 fRotationXSine = sin((3.141592653589793 + 3.141592653589793) * (double)sRotationX / 2048.0);
1639 fRotationXCosine = cos((3.141592653589793 + 3.141592653589793) * (double)sRotationX / 2048.0);
1640
1641 int_sine_y = stru_5C6E00->Sin(pGame->pIndoorCameraD3D->sRotationY);
1642 int_cosine_y = stru_5C6E00->Cos(pGame->pIndoorCameraD3D->sRotationY);
1643 int_sine_x = stru_5C6E00->Sin(pGame->pIndoorCameraD3D->sRotationX);
1644 int_cosine_x = stru_5C6E00->Cos(pGame->pIndoorCameraD3D->sRotationX);
1645 }
1646 }