Added comments / reformat

This commit is contained in:
Olly Rybak
2023-05-11 21:10:40 +10:00
parent f80ded2057
commit 395a72b7d4
3 changed files with 23 additions and 11 deletions

View File

@@ -25,7 +25,7 @@ struct AxisEvaluation
bool Used;
};
struct ActionData
struct ActionData
{
bool Active;
uint64 FrameIndex;
@@ -35,7 +35,7 @@ struct ActionData
{
Active = false;
FrameIndex = 0;
Phase = InputActionPhase::None;
Phase = InputActionPhase::Waiting;
}
};
@@ -844,11 +844,17 @@ void InputService::Update()
}
if (Input::GetKeyDown(config.Key) || Input::GetMouseButtonDown(config.MouseButton) || Input::GetGamepadButtonDown(config.Gamepad, config.GamepadButton))
{
data.Phase = InputActionPhase::Press;
}
else if (Input::GetKey(config.Key) || Input::GetMouseButton(config.MouseButton) || Input::GetGamepadButton(config.Gamepad, config.GamepadButton))
{
data.Phase = InputActionPhase::Pressing;
}
else if (Input::GetKeyUp(config.Key) || Input::GetMouseButtonUp(config.MouseButton) || Input::GetGamepadButtonUp(config.Gamepad, config.GamepadButton))
{
data.Phase = InputActionPhase::Release;
}
data.Active |= isActive;
}