mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-19 06:29:58 -04:00
Count a gamepad axis only once it has been seen at rest.
A device that reports an axis held from the start (a virtual pad nobody holds, a trigger or pedal mapped onto a stick, a stick resting far off its middle) turned the camera or moved Link on its own, and since pad_active counted it as pressed, it could take the gamepad role from the controller in the player's hands whenever that one was idle, and keep it. input.c now reads every axis through pad_axis: 0 until the axis has been within a quarter of its range of rest (a trigger's rest is 0), then the device's value. The game's sticks and triggers, the menu's stick readout and the choice of gamepad all use it. A stick the player holds at the start counts once it has been let go. Checked: the runtime compiles; new tests/pad_rest_check.py (pad_axis cut from input.c, SDL stood in for) passes: a held axis reads 0 for 100 polls, a released one reads the device, and axes and gamepads keep separate states; tests/mouse_stick_check.py still passes. Not run with a real device. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -452,6 +452,9 @@ A change to the mouse camera's stick deflection (`runtime/input_map.c` `input_mo
|
||||
deflection at each camera speed: a slow movement is divided by the factor, a fast flick reaches full tilt. No game
|
||||
files.
|
||||
|
||||
A change to how a gamepad's axes are read (`runtime/input.c` `pad_axis`: an axis counts once it has been seen at rest)
|
||||
passes `python tests\pad_rest_check.py`, which builds that function with stand-ins for SDL. No game files.
|
||||
|
||||
A change to which render passes count as drawn frame after frame (`runtime/vk_target_frames.h`: a draw into one is
|
||||
skipped while its pipeline builds, a draw into any other waits) passes `python tests\target_frames_check.py`, which
|
||||
builds the header alone and replays an area change after a loading screen from a player's log: the scene, probe and
|
||||
|
||||
Reference in New Issue
Block a user