* Improve mouse turning once again.

This commit is contained in:
iProgramInCpp
2023-07-31 21:15:42 +03:00
parent 24a693026f
commit 40961e8d8d
3 changed files with 12 additions and 1 deletions

View File

@@ -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

View File

@@ -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);
}

View File

@@ -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)
{