mirror of
https://github.com/LCEMP/LCEMP.git
synced 2026-04-23 07:24:14 +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:
parent
d017bfc30a
commit
de86a03a8a
|
|
@ -164,25 +164,6 @@ void Input::tick(LocalPlayer *player)
|
|||
|
||||
player->interpolateTurn(tx* abs(tx)* turnSpeed, ty* abs(ty)* turnSpeed);
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
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 = 5.0f;
|
||||
float mdx = dx * mouseSensitivity * mouseLookScale;
|
||||
float mdy = -dy * mouseSensitivity * mouseLookScale;
|
||||
if (app.GetGameSettings(iPad, eGameSetting_ControlInvertLook))
|
||||
mdy = -mdy;
|
||||
player->interpolateTurn(mdx, mdy);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//jumping = controller.isButtonPressed(0);
|
||||
|
||||
unsigned int jump = InputManager.GetValue(iPad, MINECRAFT_ACTION_JUMP);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue