diff options
Diffstat (limited to 'src/core/Camera.cpp')
-rw-r--r-- | src/core/Camera.cpp | 53 |
1 files changed, 42 insertions, 11 deletions
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp index 992c7d74..4bb782f2 100644 --- a/src/core/Camera.cpp +++ b/src/core/Camera.cpp @@ -114,6 +114,7 @@ CCamera::Init(void) m_1rstPersonRunCloseToAWall = false; m_fPositionAlongSpline = 0.0f; m_bCameraJustRestored = false; + m_bFreezePedZoomSwitch = false; Cams[0].Init(); Cams[1].Init(); Cams[2].Init(); @@ -985,7 +986,7 @@ CCamera::CamControl(void) // Change user selected mode if(CPad::GetPad(0)->CycleCameraModeUpJustDown() && !CReplay::IsPlayingBack() && (m_bLookingAtPlayer || WhoIsInControlOfTheCamera == CAMCONTROL_OBBE) && - !m_WideScreenOn && !m_bFailedCullZoneTestPreviously && !m_bFirstPersonBeingUsed){ + !m_WideScreenOn && !m_bFailedCullZoneTestPreviously && !m_bFirstPersonBeingUsed && !m_bFreezePedZoomSwitch){ if(FrontEndMenuManager.m_ControlMethod == CONTROL_STANDARD){ if(PedZoomIndicator == CAM_ZOOM_3) PedZoomIndicator = CAM_ZOOM_1; @@ -3863,7 +3864,7 @@ CCamera::GetScreenFadeStatus(void) } - +//--LCS: TODO void CCamera::RenderMotionBlur(void) { @@ -3872,7 +3873,8 @@ CCamera::RenderMotionBlur(void) CMBlur::MotionBlurRender(m_pRwCamera, m_BlurRed, m_BlurGreen, m_BlurBlue, - m_motionBlur, m_BlurType, m_imotionBlurAddAlpha); +// m_motionBlur, m_BlurType, m_imotionBlurAddAlpha); + m_motionBlur, m_BlurType, 32); // hack hack } void @@ -4055,9 +4057,17 @@ CCamera::CalculateDerivedValues(void) bool CCamera::IsPointVisible(const CVector ¢er, const CMatrix *mat) { - RwV3d c; - c = center; - RwV3dTransformPoints(&c, &c, 1, &mat->m_matrix); +#ifdef GTA_PS2 + CVuVector c; + TransformPoint(c, *mat, center); +#else + CVector c = center; + #ifdef FIX_BUGS + c = *mat * center; + #else + RwV3dTransformPoints(&c, &c, 1, (RwMatrix*)mat); + #endif +#endif if(c.y < CDraw::GetNearClipZ()) return false; if(c.y > CDraw::GetFarClipZ()) return false; if(c.x*m_vecFrustumNormals[0].x + c.y*m_vecFrustumNormals[0].y > 0.0f) return false; @@ -4070,9 +4080,17 @@ CCamera::IsPointVisible(const CVector ¢er, const CMatrix *mat) bool CCamera::IsSphereVisible(const CVector ¢er, float radius, const CMatrix *mat) { - RwV3d c; - c = center; - RwV3dTransformPoints(&c, &c, 1, &mat->m_matrix); +#ifdef GTA_PS2 + CVuVector c; + TransformPoint(c, *mat, center); +#else + CVector c = center; + #ifdef FIX_BUGS + c = *mat * center; + #else + RwV3dTransformPoints(&c, &c, 1, (RwMatrix*)mat); + #endif +#endif if(c.y + radius < CDraw::GetNearClipZ()) return false; if(c.y - radius > CDraw::GetFarClipZ()) return false; if(c.x*m_vecFrustumNormals[0].x + c.y*m_vecFrustumNormals[0].y > radius) return false; @@ -4090,11 +4108,24 @@ CCamera::IsSphereVisible(const CVector ¢er, float radius) } bool -CCamera::IsBoxVisible(RwV3d *box, const CMatrix *mat) +#ifdef GTA_PS2 +CCamera::IsBoxVisible(CVuVector *box, const CMatrix *mat) +#else +CCamera::IsBoxVisible(CVector *box, const CMatrix *mat) +#endif { int i; int frustumTests[6] = { 0 }; - RwV3dTransformPoints(box, box, 8, &mat->m_matrix); +#ifdef GTA_PS2 + TransformPoints(box, 8, *mat, box); +#else + #ifdef FIX_BUGS + for (i = 0; i < 8; i++) + box[i] = *mat * box[i]; + #else + RwV3dTransformPoints(box, box, 8, (RwMatrix*)mat); + #endif +#endif for(i = 0; i < 8; i++){ if(box[i].y < CDraw::GetNearClipZ()) frustumTests[0]++; |