From 40961e8d8d3e8285ad93330a81aa10083a8c0950 Mon Sep 17 00:00:00 2001 From: iProgramInCpp Date: Mon, 31 Jul 2023 21:15:42 +0300 Subject: [PATCH] * Improve mouse turning once again. --- GameMods.hpp | 1 + source/Renderer/GameRenderer.cpp | 10 ++++++++++ source/UserInput/MouseTurnInput.cpp | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/GameMods.hpp b/GameMods.hpp index 437e841..dfaac8c 100644 --- a/GameMods.hpp +++ b/GameMods.hpp @@ -27,6 +27,7 @@ #define ENH_ALLOW_SAND_GRAVITY // Allow sand to fall. #define ENH_USE_GUI_SCALE_2 // Use a 2x GUI scale instead of 3x. Looks better on PC #define ENH_ALLOW_SCROLL_WHEEL // Allow use of the scroll wheel to change selected inventory slots +#define ENH_DISABLE_TURN_ACCEL // Disable the turn acceleration mechanism. It should only be used on Xperia Play // Mods //#define MOD_USE_FLAT_WORLD // Use a flat world instead of the regular world generation diff --git a/source/Renderer/GameRenderer.cpp b/source/Renderer/GameRenderer.cpp index 894647e..ea7bd47 100644 --- a/source/Renderer/GameRenderer.cpp +++ b/source/Renderer/GameRenderer.cpp @@ -477,6 +477,7 @@ void GameRenderer::render(float f) pMC->field_D20 = delta.x; pMC->field_D24 = delta.y; +#ifndef ENH_DISABLE_TURN_ACCEL float multPitch = -1.0f; float mult1 = 2.0f * (0.2f + pMC->m_options.field_8 * 0.6f); mult1 = mult1 * mult1 * mult1; @@ -519,6 +520,15 @@ void GameRenderer::render(float f) v25 = v24; field_24 = v23 + v25; } +#else + float multPitch = -1.0f; + if (pMC->m_options.m_bInvertMouse) + multPitch = 1.0f; + + float diff_field_84 = 1.0f; + field_7C = pMC->field_D20; + field_80 = pMC->field_D24; +#endif pMC->m_pLocalPlayer->turn(diff_field_84 * field_7C, diff_field_84 * multPitch * field_80); } diff --git a/source/UserInput/MouseTurnInput.cpp b/source/UserInput/MouseTurnInput.cpp index 101316f..7918ba2 100644 --- a/source/UserInput/MouseTurnInput.cpp +++ b/source/UserInput/MouseTurnInput.cpp @@ -9,7 +9,7 @@ #include "MouseTurnInput.hpp" #include "Mouse.hpp" -constexpr float C_SENSITIVITY = 0.5f; +constexpr float C_SENSITIVITY = 1.0f; MouseTurnInput::MouseTurnInput(Minecraft* pMC) {