From a5b84eb9fe32689f0aee10077854a3652c986c08 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sun, 17 May 2020 21:43:11 +0300 Subject: full script basic support --- src/core/Camera.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/core/Camera.cpp') diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp index 623b2ea9..1efe6bae 100644 --- a/src/core/Camera.cpp +++ b/src/core/Camera.cpp @@ -61,6 +61,8 @@ enum CCamera TheCamera; bool CCamera::m_bUseMouse3rdPerson = true; bool bDidWeProcessAnyCinemaCam; +float CCamera::m_f3rdPersonCHairMultX; +float CCamera::m_f3rdPersonCHairMultY; #ifdef IMPROVED_CAMERA #define KEYJUSTDOWN(k) ControlsManager.GetIsKeyboardKeyJustDown((RsKeyCodes)k) -- cgit v1.2.3 From bdbe5d1080066073f063d653e80df6dbf4b326a2 Mon Sep 17 00:00:00 2001 From: aap Date: Tue, 19 May 2020 20:56:42 +0200 Subject: CEntity and friends --- src/core/Camera.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/core/Camera.cpp') diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp index 1efe6bae..fa5e44bb 100644 --- a/src/core/Camera.cpp +++ b/src/core/Camera.cpp @@ -82,10 +82,6 @@ CCamera::CCamera(void) Init(); } -CCamera::CCamera(float) -{ -} - void CCamera::Init(void) { @@ -93,12 +89,7 @@ CCamera::Init(void) float fMouseAccelHorzntl = m_fMouseAccelHorzntl; float fMouseAccelVertical = m_fMouseAccelVertical; #endif -#ifdef FIX_BUGS - static const CCamera DummyCamera = CCamera(0.f); - *this = DummyCamera; -#else - memset(this, 0, sizeof(CCamera)); // getting rid of vtable, eh? -#endif + memset(this, 0, sizeof(CCamera)); // this is fine, no vtable #ifdef GTA3_1_1_PATCH m_fMouseAccelHorzntl = fMouseAccelHorzntl; m_fMouseAccelVertical = fMouseAccelVertical; -- cgit v1.2.3 From a5f23a03424cf312add998edce6ef4122c0a29d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Fri, 22 May 2020 02:44:01 +0300 Subject: VC CMenuManager struct, ctor etc. --- src/core/Camera.cpp | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'src/core/Camera.cpp') diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp index fa5e44bb..486c2c9e 100644 --- a/src/core/Camera.cpp +++ b/src/core/Camera.cpp @@ -3037,33 +3037,25 @@ CCamera::SetNearClipScript(float clip) void CCamera::ProcessFade(void) { - float fade = (CTimer::GetTimeInMilliseconds() - m_uiFadeTimeStarted)/1000.0f; - // Why even set CDraw::FadeValue if m_fFLOATingFade sets it anyway? if(m_bFading){ if(m_iFadingDirection == FADE_IN){ if(m_fTimeToFadeOut != 0.0f){ - m_fFLOATingFade = 255.0f - 255.0f*fade/m_fTimeToFadeOut; - if(m_fFLOATingFade <= 0.0f){ - m_bFading = false; - CDraw::FadeValue = 0; - m_fFLOATingFade = 0.0f; - } + m_fFLOATingFade -= CTimer::GetTimeStepInSeconds() * 255.0f / m_fTimeToFadeOut; }else{ + m_fFLOATingFade = 0.0f; + } + if (m_fFLOATingFade <= 0.0f) { m_bFading = false; - CDraw::FadeValue = 0; m_fFLOATingFade = 0.0f; } }else if(m_iFadingDirection == FADE_OUT){ if(m_fTimeToFadeOut != 0.0f){ - m_fFLOATingFade = 255.0f*fade/m_fTimeToFadeOut; - if(m_fFLOATingFade >= 255.0f){ - m_bFading = false; - CDraw::FadeValue = 255; - m_fFLOATingFade = 255.0f; - } + m_fFLOATingFade += CTimer::GetTimeStepInSeconds() * 255.0f / m_fTimeToFadeOut; }else{ + m_fFLOATingFade = 255.0f; + } + if (m_fFLOATingFade >= 255.0f) { m_bFading = false; - CDraw::FadeValue = 255; m_fFLOATingFade = 255.0f; } } -- cgit v1.2.3 From 4870d9a31be6302037eb7ddcf0b99ea25ebccabc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Sun, 24 May 2020 02:59:30 +0300 Subject: Menu borders and weapon fixes --- src/core/Camera.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/core/Camera.cpp') diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp index 486c2c9e..3b7bdbaf 100644 --- a/src/core/Camera.cpp +++ b/src/core/Camera.cpp @@ -3117,15 +3117,6 @@ CCamera::Fade(float timeout, int16 direction) m_iMusicFadingDirection = direction; m_fTimeToFadeMusic = timeout; m_uiFadeTimeStartedMusic = CTimer::GetTimeInMilliseconds(); -// Not on PS2 - if(!m_bJustJumpedOutOf1stPersonBecauseOfTarget && m_iMusicFadingDirection == FADE_OUT){ - unknown++; - if(unknown >= 2){ - m_bJustJumpedOutOf1stPersonBecauseOfTarget = true; - unknown = 0; - }else - m_bMoveCamToAvoidGeom = true; - } } } @@ -3314,8 +3305,9 @@ CCamera::CalculateDerivedValues(void) // left plane m_vecFrustumNormals[1] = CVector(-c, -s, 0.0f); - c /= CDraw::FindAspectRatio(); - s /= CDraw::FindAspectRatio(); + CDraw::CalculateAspectRatio(); + c /= SCREEN_ASPECT_RATIO; + s /= SCREEN_ASPECT_RATIO; // bottom plane m_vecFrustumNormals[2] = CVector(0.0f, -s, -c); // top plane -- cgit v1.2.3 From 7bf833785411955c2bcf35ed55e9d206facbc575 Mon Sep 17 00:00:00 2001 From: aap Date: Sun, 24 May 2020 15:14:27 +0200 Subject: CVehicle --- src/core/Camera.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/core/Camera.cpp') diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp index 3b7bdbaf..f618c652 100644 --- a/src/core/Camera.cpp +++ b/src/core/Camera.cpp @@ -3281,6 +3281,18 @@ CCamera::Find3rdPersonQuickAimPitch(void) return -(DEGTORAD(((0.5f - m_f3rdPersonCHairMultY) * 1.8f * 0.5f * Cams[ActiveCam].FOV)) + rot); } +bool +CCamera::Using1stPersonWeaponMode(void) +{ + switch(PlayerWeaponMode.Mode) + case CCam::MODE_SNIPER: + case CCam::MODE_M16_1STPERSON: + case CCam::MODE_ROCKETLAUNCHER: + case CCam::MODE_HELICANNON_1STPERSON: + case CCam::MODE_CAMERA: + return true; + return false; +} void -- cgit v1.2.3 From 7f60be9814894fc5c6e9fbc9d52be492c8c92a11 Mon Sep 17 00:00:00 2001 From: aap Date: Tue, 26 May 2020 18:50:11 +0200 Subject: fix UB shit --- src/core/Camera.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/Camera.cpp') diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp index f618c652..b65b60f3 100644 --- a/src/core/Camera.cpp +++ b/src/core/Camera.cpp @@ -3193,7 +3193,7 @@ CCamera::GetLookDirection(void) Cams[ActiveCam].Mode == CCam::MODE_BEHINDBOAT || Cams[ActiveCam].Mode == CCam::MODE_FOLLOWPED) return Cams[ActiveCam].DirectionWasLooking; - return LOOKING_FORWARD;; + return LOOKING_FORWARD; } bool -- cgit v1.2.3