added some kbm stuff

This commit is contained in:
2026-09-13 19:41:44 -07:00
parent 82e802873f
commit 5023e0a8d6
217 changed files with 3744 additions and 235 deletions
+40 -2
View File
@@ -40,6 +40,17 @@ void Input::tick(LocalPlayer *player)
else
ya = 0.0f;
#ifdef _WINDOWS64
if (InputManager.IsMouseCaptured())
{
if (InputManager.IsKeyDown('A')) xa = 1.0f;
else if (InputManager.IsKeyDown('D')) xa = -1.0f;
if (InputManager.IsKeyDown('W')) ya = 1.0f;
else if (InputManager.IsKeyDown('S')) ya = -1.0f;
}
#endif
#ifndef _CONTENT_PACKAGE
if (app.GetFreezePlayers())
{
@@ -99,8 +110,25 @@ void Input::tick(LocalPlayer *player)
}
tx = ty = 0.0f;
}
player->interpolateTurn(tx * abs(tx) * turnSpeed, ty * abs(ty) * turnSpeed);
float turnX = tx * abs(tx) * turnSpeed;
float turnY = ty * abs(ty) * turnSpeed;
#ifdef _WINDOWS64
if (InputManager.IsMouseCaptured())
{
float mouseSensitivity = ((float)app.GetGameSettings(iPad,eGameSetting_Sensitivity_InGame)) / 100.0f;
float mx = (float)InputManager.GetRawMouseX() * (mouseSensitivity * 5.0f);
float my = -(float)InputManager.GetRawMouseY() * (mouseSensitivity * 5.0f);
if ( app.GetGameSettings(iPad,eGameSetting_ControlInvertLook) )
my = -my;
turnX += mx;
turnY += my;
}
#endif
player->interpolateTurn(turnX, turnY);
//jumping = controller.isButtonPressed(0);
@@ -110,6 +138,16 @@ void Input::tick(LocalPlayer *player)
else
jumping = false;
#ifdef _WINDOWS64
if (InputManager.IsMouseCaptured())
{
if (InputManager.IsKeyDown(VK_SPACE)) jumping = true;
if (InputManager.IsKeyDown(VK_SHIFT)) sneaking = true;
else sneaking = false;
sprinting = InputManager.IsKeyDown(VK_CONTROL);
}
#endif
#ifndef _CONTENT_PACKAGE
if (app.GetFreezePlayers()) jumping = false;
#endif