diff options
| author | engineer124 <47598039+engineer124@users.noreply.github.com> | 2023-09-24 02:52:06 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-23 13:52:06 -0300 |
| commit | b88aa2c0fc996a911cadb2d34a0b18e6c3457c88 (patch) | |
| tree | 691316d42301135e10d762783ce391deeae8de64 /src/code/z_lib.c | |
| parent | cfe656be2fe638aaf15599c97709e1b3924411a3 (diff) | |
Player docs: Control Stick Input and Movement (#1385)
* player input docs
* player prefix
* rm comments
* TRUNCF_BINANG
Diffstat (limited to 'src/code/z_lib.c')
| -rw-r--r-- | src/code/z_lib.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/code/z_lib.c b/src/code/z_lib.c index 553c5d133..634f0a47f 100644 --- a/src/code/z_lib.c +++ b/src/code/z_lib.c @@ -240,20 +240,20 @@ s32 Math_AsymStepToF(f32* pValue, f32 target, f32 incrStep, f32 decrStep) { return false; } -void func_800FF3A0(f32* distOut, s16* angleOut, Input* input) { +void Lib_GetControlStickData(f32* outMagnitude, s16* outAngle, Input* input) { f32 x = input->rel.stick_x; f32 y = input->rel.stick_y; - f32 dist; + f32 magnitude; - dist = sqrtf(SQ(x) + SQ(y)); - *distOut = (60.0f < dist) ? 60.0f : dist; + magnitude = sqrtf(SQ(x) + SQ(y)); + *outMagnitude = (60.0f < magnitude) ? 60.0f : magnitude; - if (dist > 0.0f) { + if (magnitude > 0.0f) { x = input->cur.stick_x; y = input->cur.stick_y; - *angleOut = Math_Atan2S_XY(y, -x); + *outAngle = Math_Atan2S_XY(y, -x); } else { - *angleOut = 0; + *outAngle = 0; } } |
