summaryrefslogtreecommitdiff
path: root/src/code/z_sub_s.c
diff options
context:
space:
mode:
authorDerek Hensley <hensley.derek58@gmail.com>2023-04-18 13:34:58 -0700
committerGitHub <noreply@github.com>2023-04-18 16:34:58 -0400
commit823746d49530318331f29af92fa924a15f2482a1 (patch)
tree2931bf8e06b9e1d2ef13774e3fb2b25ac3b4d0fa /src/code/z_sub_s.c
parenta67d086addc1d0e226c28cadf58dda5e637d58ba (diff)
Angle Conversions (#1216)
* Angle Conversions * Format * namefixer * Renames in ObjHsStump_Appear * Format * once more * Explicit cast in EnSsh * Update src/overlays/actors/ovl_En_Fishing/z_en_fishing.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> --------- Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
Diffstat (limited to 'src/code/z_sub_s.c')
-rw-r--r--src/code/z_sub_s.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/code/z_sub_s.c b/src/code/z_sub_s.c
index 6650f41a7..210d6c36f 100644
--- a/src/code/z_sub_s.c
+++ b/src/code/z_sub_s.c
@@ -577,7 +577,7 @@ s32 SubS_HasReachedPoint(Actor* actor, Path* path, s32 pointIndex) {
diffZ = points[index + 1].z - points[index - 1].z;
}
- func_8017B7F8(&point, RADF_TO_BINANG(func_80086B30(diffX, diffZ)), &px, &pz, &d);
+ func_8017B7F8(&point, RAD_TO_BINANG(func_80086B30(diffX, diffZ)), &px, &pz, &d);
if (((px * actor->world.pos.x) + (pz * actor->world.pos.z) + d) > 0.0f) {
reached = true;
}
@@ -1023,13 +1023,13 @@ s16 SubS_ComputeTrackPointRot(s16* rot, s16 rotMax, s16 target, f32 slowness, f3
f32 step;
f32 prevRotStep;
- step = (f32)(target - *rot) * (360.0f / (f32)0x10000);
+ step = BINANG_TO_DEG(target - *rot);
step *= gFramerateDivisorHalf;
prevRotStep = step;
if (step >= 0.0f) {
step /= slowness;
step = CLAMP(step, stepMin, stepMax);
- *rot += (s16)((step * (f32)0x10000) / 360.0f);
+ *rot += DEG_TO_BINANG_ALT2(step);
if (prevRotStep < stepMin) {
*rot = target;
}
@@ -1039,7 +1039,7 @@ s16 SubS_ComputeTrackPointRot(s16* rot, s16 rotMax, s16 target, f32 slowness, f3
} else {
step = (step / slowness) * -1.0f;
step = CLAMP(step, stepMin, stepMax);
- *rot -= (s16)((step * (f32)0x10000) / 360.0f);
+ *rot -= DEG_TO_BINANG_ALT2(step);
if (-stepMin < prevRotStep) {
*rot = target;
}