mirror of
https://github.com/LCEMP/LCEMP.git
synced 2026-06-10 01:13:26 +00:00
Mouse improvements
Mouse look was previously being changed on Input::tick which only runs 20 times per second and then it was interpolated to make it feel better. I moved it to the WndProc function and stopped interpolating. I also changed the mouseLookScale to 1 because it was a lot faster than before.
This commit is contained in:
@@ -493,6 +493,35 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef _WINDOWS64
|
||||
Minecraft* instance = Minecraft::GetInstance();
|
||||
if (!instance)
|
||||
break;
|
||||
|
||||
LocalPlayer* player = instance->localplayers[0].get();
|
||||
if (!player)
|
||||
break;
|
||||
|
||||
int iPad = player->GetXboxPad();
|
||||
if (iPad == 0 && g_KBMInput.IsMouseGrabbed() && g_KBMInput.IsKBMActive())
|
||||
{
|
||||
int dx = g_KBMInput.GetRawDeltaX();
|
||||
int dy = g_KBMInput.GetRawDeltaY();
|
||||
g_KBMInput.ConsumeMouseDelta();
|
||||
|
||||
if (dx != 0 || dy != 0)
|
||||
{
|
||||
float mouseSensitivity = ((float)app.GetGameSettings(iPad, eGameSetting_Sensitivity_InGame)) / 100.0f;
|
||||
float mouseLookScale = 1.0f;
|
||||
float mdx = dx * mouseSensitivity * mouseLookScale;
|
||||
float mdy = -dy * mouseSensitivity * mouseLookScale;
|
||||
|
||||
if (app.GetGameSettings(iPad, eGameSetting_ControlInvertLook))
|
||||
mdy = -mdy;
|
||||
instance->player->turn(mdx, mdy);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user