From 4703ec5164acd169f4ce315a0f035bc6ab554f0b Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sun, 17 Jan 2021 16:03:37 +0300 Subject: sync --- src/core/Pad.h | 10 ++++++++++ src/core/Radar.cpp | 2 ++ src/core/main.cpp | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/Pad.h b/src/core/Pad.h index 3a4f54b3..a3634134 100644 --- a/src/core/Pad.h +++ b/src/core/Pad.h @@ -277,6 +277,16 @@ public: uint32 InputHowLongAgo(void); void SetDrunkInputDelay(int32 delay) { DrunkDrivingBufferUsed = delay; } + // TODO(LCS): properly, this is just to get some estimation for script + int16 GetOddJobTrigger() { return GetRightShockJustDown(); } + int16 GuiLeft() { return GetAnaloguePadLeft() || GetDPadLeftJustDown(); } + int16 GuiRight() { return GetAnaloguePadRight() || GetDPadRightJustDown(); } + int16 GuiUp() { return GetAnaloguePadUp() || GetDPadUpJustDown(); } + int16 GuiDown() { return GetAnaloguePadDown() || GetDPadDownJustDown(); } + int16 GuiSelect() { return GetSelect(); } + int16 GuiBack() { return GetStart(); } + int16 GetSkipCutscene() { return GetCrossJustDown(); } + #ifdef XINPUT void AffectFromXinput(uint32 pad); #endif diff --git a/src/core/Radar.cpp b/src/core/Radar.cpp index d9802acc..b7787627 100644 --- a/src/core/Radar.cpp +++ b/src/core/Radar.cpp @@ -1129,6 +1129,7 @@ void CRadar::SetRadarMarkerState(int32 counter, bool flag) } void CRadar::ShowRadarMarker(CVector pos, uint32 color, float radius) { + /* float f1 = radius * 1.4f; float f2 = radius * 0.5f; CVector p1, p2; @@ -1148,6 +1149,7 @@ void CRadar::ShowRadarMarker(CVector pos, uint32 color, float radius) { p1 = pos - TheCamera.GetRight()*f1; p2 = pos - TheCamera.GetRight()*f2; CTheScripts::ScriptDebugLine3D(p1.x, p1.y, p1.z, p2.x, p2.y, p2.z, color, color); + */ } void CRadar::ShowRadarTrace(float x, float y, uint32 size, uint8 red, uint8 green, uint8 blue, uint8 alpha) diff --git a/src/core/main.cpp b/src/core/main.cpp index 7f73c311..3632807c 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -1275,7 +1275,7 @@ RenderScene(void) void RenderDebugShit(void) { - CTheScripts::RenderTheScriptDebugLines(); + //CTheScripts::RenderTheScriptDebugLines(); #ifndef FINAL if(gbShowCollisionLines) CRenderer::RenderCollisionLines(); -- cgit v1.2.3 From b5c09965a97574adbac6ef6f07ec382ef8d5c6c8 Mon Sep 17 00:00:00 2001 From: withmorten Date: Mon, 18 Jan 2021 17:25:31 +0100 Subject: some free cam fixes for controller --- src/core/Cam.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/core') diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp index bb3a0fbe..d3768a2c 100644 --- a/src/core/Cam.cpp +++ b/src/core/Cam.cpp @@ -5066,6 +5066,13 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation, float stickX = -(pad->GetCarGunLeftRight()); float stickY = pad->GetCarGunUpDown(); + // In SA this checks for m_bUseMouse3rdPerson so num2 / num8 do not move camera + // when Keyboard & Mouse controls are used. To make it work better with III/VC, check for actual pad state instead + if (!CPad::IsAffectedByController && !isCar) + stickY = 0.0f; + else if (CPad::bInvertLook4Pad) + stickY = -stickY; + if (CCamera::m_bUseMouse3rdPerson) stickY = 0.0f; -- cgit v1.2.3 From 776693235cf38395a4664f3df90c9d2d00e09513 Mon Sep 17 00:00:00 2001 From: withmorten Date: Mon, 18 Jan 2021 17:30:18 +0100 Subject: fix --- src/core/Cam.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/core') diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp index d3768a2c..47c944a5 100644 --- a/src/core/Cam.cpp +++ b/src/core/Cam.cpp @@ -5073,9 +5073,6 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation, else if (CPad::bInvertLook4Pad) stickY = -stickY; - if (CCamera::m_bUseMouse3rdPerson) - stickY = 0.0f; - float xMovement = Abs(stickX) * (FOV / 80.0f * 5.f / 70.f) * stickX * 0.007f * 0.007f; float yMovement = Abs(stickY) * (FOV / 80.0f * 3.f / 70.f) * stickY * 0.007f * 0.007f; -- cgit v1.2.3