mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2026-04-25 19:42:20 +00:00
Requested change
This commit is contained in:
parent
9847380130
commit
fa5ca5a0fd
1 changed files with 1 additions and 3 deletions
|
|
@ -178,8 +178,6 @@ static inline void update_button(const int i, const bool new) {
|
|||
|
||||
static inline void update_analog_stick(s8 *stick_x, s8 *stick_y,
|
||||
int16_t input_x, int16_t input_y) {
|
||||
static const float INPUT_ABS_MAX = 0x8000;
|
||||
|
||||
float magnitude_sq = (float)(input_x * input_x) + (float)(input_y * input_y);
|
||||
float deadzone = configStickDeadzone * DEADZONE_STEP;
|
||||
|
||||
|
|
@ -188,7 +186,7 @@ static inline void update_analog_stick(s8 *stick_x, s8 *stick_y,
|
|||
float dir_x = (float)input_x / magnitude;
|
||||
float dir_y = (float)input_y / magnitude;
|
||||
float scale = 1.f / fmaxf(fabsf(dir_x), fabsf(dir_y));
|
||||
float max_magnitude = INPUT_ABS_MAX * scale;
|
||||
float max_magnitude = 0x8000 * scale;
|
||||
|
||||
magnitude -= deadzone;
|
||||
magnitude *= max_magnitude / (max_magnitude - deadzone);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue