diff options
author | Filip Gawin <filip.gawin@zoho.com> | 2020-02-25 20:01:56 +0100 |
---|---|---|
committer | Filip Gawin <filip.gawin@zoho.com> | 2020-03-22 17:30:54 +0100 |
commit | 8f01eab5ab97c498fd308c091ad9c555b2f67b56 (patch) | |
tree | c7b9b88d8b77ab3559be411dbbfeda98e3294c7b /src/core | |
parent | Implement ProcessGarages + small cleanup (diff) | |
download | re3-8f01eab5ab97c498fd308c091ad9c555b2f67b56.tar re3-8f01eab5ab97c498fd308c091ad9c555b2f67b56.tar.gz re3-8f01eab5ab97c498fd308c091ad9c555b2f67b56.tar.bz2 re3-8f01eab5ab97c498fd308c091ad9c555b2f67b56.tar.lz re3-8f01eab5ab97c498fd308c091ad9c555b2f67b56.tar.xz re3-8f01eab5ab97c498fd308c091ad9c555b2f67b56.tar.zst re3-8f01eab5ab97c498fd308c091ad9c555b2f67b56.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/Camera.cpp | 132 | ||||
-rw-r--r-- | src/core/Timer.cpp | 2 | ||||
-rw-r--r-- | src/core/common.h | 1 | ||||
-rw-r--r-- | src/core/main.cpp | 2 |
4 files changed, 68 insertions, 69 deletions
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp index 88c87c95..fc056038 100644 --- a/src/core/Camera.cpp +++ b/src/core/Camera.cpp @@ -416,17 +416,17 @@ CCam::Process_FollowPed(const CVector &CameraTarget, float TargetOrientation, fl // BUG? is this ever used? // The values seem to be roughly m_fPedZoomValueSmooth + 1.85 if(ResetStatics){ - if(TheCamera.PedZoomIndicator == 1.0) m_fRealGroundDist = 2.090556f; - if(TheCamera.PedZoomIndicator == 2.0) m_fRealGroundDist = 3.34973f; - if(TheCamera.PedZoomIndicator == 3.0) m_fRealGroundDist = 4.704914f; - if(TheCamera.PedZoomIndicator == 4.0) m_fRealGroundDist = 2.090556f; + if(TheCamera.PedZoomIndicator == 1.0f) m_fRealGroundDist = 2.090556f; + if(TheCamera.PedZoomIndicator == 2.0f) m_fRealGroundDist = 3.34973f; + if(TheCamera.PedZoomIndicator == 3.0f) m_fRealGroundDist = 4.704914f; + if(TheCamera.PedZoomIndicator == 4.0f) m_fRealGroundDist = 2.090556f; } // And what is this? It's only used for collision and rotation it seems float RealGroundDist; - if(TheCamera.PedZoomIndicator == 1.0) RealGroundDist = 2.090556f; - if(TheCamera.PedZoomIndicator == 2.0) RealGroundDist = 3.34973f; - if(TheCamera.PedZoomIndicator == 3.0) RealGroundDist = 4.704914f; - if(TheCamera.PedZoomIndicator == 4.0) RealGroundDist = 2.090556f; + if(TheCamera.PedZoomIndicator == 1.0f) RealGroundDist = 2.090556f; + if(TheCamera.PedZoomIndicator == 2.0f) RealGroundDist = 3.34973f; + if(TheCamera.PedZoomIndicator == 3.0f) RealGroundDist = 4.704914f; + if(TheCamera.PedZoomIndicator == 4.0f) RealGroundDist = 2.090556f; if(m_fCloseInPedHeightOffset > 0.00001f) RealGroundDist = 1.7016; @@ -1344,30 +1344,30 @@ CCamera::SetCamCutSceneOffSet(const CVector &pos) void CCamera::TakeControlWithSpline(short nSwitch) { - m_iModeToGoTo = CCam::MODE_FLYBY;
- m_bLookingAtPlayer = false;
- m_bLookingAtVector = false;
- m_bcutsceneFinished = false;
- m_iTypeOfSwitch = nSwitch;
- m_bStartInterScript = true;
-
+ m_iModeToGoTo = CCam::MODE_FLYBY; + m_bLookingAtPlayer = false; + m_bLookingAtVector = false; + m_bcutsceneFinished = false; + m_iTypeOfSwitch = nSwitch; + m_bStartInterScript = true; + //FindPlayerPed(); // unused }; -void CCamera::SetCameraDirectlyInFrontForFollowPed_CamOnAString()
-{
- m_bCamDirectlyInFront = true;
- CPlayerPed *player = FindPlayerPed();
- if (player)
- m_PedOrientForBehindOrInFront = CGeneral::GetATanOfXY(player->GetForward().x, player->GetForward().y);
+void CCamera::SetCameraDirectlyInFrontForFollowPed_CamOnAString() +{ + m_bCamDirectlyInFront = true; + CPlayerPed *player = FindPlayerPed(); + if (player) + m_PedOrientForBehindOrInFront = CGeneral::GetATanOfXY(player->GetForward().x, player->GetForward().y); } -void CCamera::SetCameraDirectlyBehindForFollowPed_CamOnAString()
-{
- m_bCamDirectlyBehind = true;
- CPlayerPed *player = FindPlayerPed();
- if (player)
- m_PedOrientForBehindOrInFront = CGeneral::GetATanOfXY(player->GetForward().x, player->GetForward().y);
+void CCamera::SetCameraDirectlyBehindForFollowPed_CamOnAString() +{ + m_bCamDirectlyBehind = true; + CPlayerPed *player = FindPlayerPed(); + if (player) + m_PedOrientForBehindOrInFront = CGeneral::GetATanOfXY(player->GetForward().x, player->GetForward().y); } void @@ -1382,80 +1382,80 @@ CCamera::SetWideScreenOff(void) m_bWantsToSwitchWidescreenOff = m_WideScreenOn; } -void
-CCamera::SetNewPlayerWeaponMode(int16 mode, int16 minZoom, int16 maxZoom)
-{
- PlayerWeaponMode.Mode = mode;
- PlayerWeaponMode.MaxZoom = maxZoom;
- PlayerWeaponMode.MinZoom = minZoom;
- PlayerWeaponMode.Duration = 0.0f;
+void +CCamera::SetNewPlayerWeaponMode(int16 mode, int16 minZoom, int16 maxZoom) +{ + PlayerWeaponMode.Mode = mode; + PlayerWeaponMode.MaxZoom = maxZoom; + PlayerWeaponMode.MinZoom = minZoom; + PlayerWeaponMode.Duration = 0.0f; } -void
-CCamera::UpdateAimingCoors(CVector const &coors)
-{
- m_cvecAimingTargetCoors = coors;
+void +CCamera::UpdateAimingCoors(CVector const &coors) +{ + m_cvecAimingTargetCoors = coors; } void CCamera::SetCamPositionForFixedMode(const CVector &Source, const CVector &UpOffSet) { - m_vecFixedModeSource = Source;
+ m_vecFixedModeSource = Source; m_vecFixedModeUpOffSet = UpOffSet; } void CCamera::SetRwCamera(RwCamera *cam) { - m_pRwCamera = cam;
- m_viewMatrix.Attach(&m_pRwCamera->viewMatrix, false);
+ m_pRwCamera = cam; + m_viewMatrix.Attach(&m_pRwCamera->viewMatrix, false); CMBlur::MotionBlurOpen(m_pRwCamera); } uint32 CCamera::GetCutSceneFinishTime(void) { - int cam = ActiveCam;
- if (Cams[cam].Mode == CCam::MODE_FLYBY)
- return Cams[cam].m_uiFinishTime;
- cam = (cam + 1) % 2;
- if (Cams[cam].Mode == CCam::MODE_FLYBY)
- return Cams[cam].m_uiFinishTime;
-
+ int cam = ActiveCam; + if (Cams[cam].Mode == CCam::MODE_FLYBY) + return Cams[cam].m_uiFinishTime; + cam = (cam + 1) % 2; + if (Cams[cam].Mode == CCam::MODE_FLYBY) + return Cams[cam].m_uiFinishTime; + return 0; } void CCamera::FinishCutscene(void) { - SetPercentAlongCutScene(100.0f);
- m_fPositionAlongSpline = 1.0f;
+ SetPercentAlongCutScene(100.0f); + m_fPositionAlongSpline = 1.0f; m_bcutsceneFinished = true; } void CCamera::SetZoomValueFollowPedScript(int16 mode) -{
- switch (mode) {
- case 0: m_fPedZoomValueScript = 0.25f; break;
- case 1: m_fPedZoomValueScript = 1.5f; break;
- case 2: m_fPedZoomValueScript = 2.9f; break;
- default: m_fPedZoomValueScript = m_fPedZoomValueScript; break;
- }
-
+{ + switch (mode) { + case 0: m_fPedZoomValueScript = 0.25f; break; + case 1: m_fPedZoomValueScript = 1.5f; break; + case 2: m_fPedZoomValueScript = 2.9f; break; + default: m_fPedZoomValueScript = m_fPedZoomValueScript; break; + } + m_bUseScriptZoomValuePed = true; } void CCamera::SetZoomValueCamStringScript(int16 mode) -{
- switch (mode) {
- case 0: m_fCarZoomValueScript = 0.05f; break;
- case 1: m_fCarZoomValueScript = 1.9f; break;
- case 2: m_fCarZoomValueScript = 3.9f; break;
- default: m_fCarZoomValueScript = m_fCarZoomValueScript; break;
- }
-
+{ + switch (mode) { + case 0: m_fCarZoomValueScript = 0.05f; break; + case 1: m_fCarZoomValueScript = 1.9f; break; + case 2: m_fCarZoomValueScript = 3.9f; break; + default: m_fCarZoomValueScript = m_fCarZoomValueScript; break; + } + m_bUseScriptZoomValueCar = true; } diff --git a/src/core/Timer.cpp b/src/core/Timer.cpp index 8695f64b..bcf84560 100644 --- a/src/core/Timer.cpp +++ b/src/core/Timer.cpp @@ -103,7 +103,7 @@ void CTimer::Update(void) { m_snTimeInMilliseconds = m_snTimeInMilliseconds + upd; m_snTimeInMillisecondsNonClipped = m_snTimeInMillisecondsNonClipped + upd; - ms_fTimeStep = updInCyclesScaled / (double)_nCyclesPerMS / 20.0; + ms_fTimeStep = updInCyclesScaled / (double)_nCyclesPerMS / 20.0f; } } else diff --git a/src/core/common.h b/src/core/common.h index 562a69b4..3127cb12 100644 --- a/src/core/common.h +++ b/src/core/common.h @@ -4,7 +4,6 @@ #define _USE_MATH_DEFINES #pragma warning(disable: 4244) // int to float #pragma warning(disable: 4800) // int to bool -#pragma warning(disable: 4305) // double to float #pragma warning(disable: 4838) // narrowing conversion #pragma warning(disable: 4996) // POSIX names diff --git a/src/core/main.cpp b/src/core/main.cpp index c13d3618..6043074f 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -216,7 +216,7 @@ Idle(void *arg) RenderEffects(); if((TheCamera.m_BlurType == MBLUR_NONE || TheCamera.m_BlurType == MBLUR_NORMAL) && - TheCamera.m_ScreenReductionPercentage > 0.0) + TheCamera.m_ScreenReductionPercentage > 0.0f) TheCamera.SetMotionBlurAlpha(150); TheCamera.RenderMotionBlur(); |