MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / IsActionBoundToRecentAxis

Method IsActionBoundToRecentAxis

engine/Poseidon/Input/InputSubsystem.cpp:845–866  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

843
844bool InputSubsystem::IsActionBoundToRecentAxis(UserAction action) const
845{
846 const int idx = static_cast<int>(context_);
847 if (idx < 0 || idx >= kNumContexts)
848 return false;
849
850 const auto& bindings = profiles_[idx].GetBindingEntries(action);
851 for (const InputBinding& binding : bindings)
852 {
853 int key = binding.code.toLegacy();
854 if ((key & INPUT_DEVICE_MASK) == INPUT_DEVICE_STICK_AXIS)
855 {
856 int axis = key - INPUT_DEVICE_STICK_AXIS;
857 if (axis >= 0 && axis < N_JOYSTICK_AXES)
858 {
859 if (GInput.gamepad.jAxisLastActive[axis] >= Glob.uiTime - 0.1)
860 return true;
861 }
862 }
863 }
864 return false;
865}
866
867float InputSubsystem::GetStickForward() const
868{
869 float legacyAxis = -GetAction(UAAxisDive, true);

Callers 2

Calls 1

toLegacyMethod · 0.80

Tested by

no test coverage detected