diff options
| author | Derek Hensley <hensley.derek58@gmail.com> | 2024-06-03 11:33:03 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-03 14:33:03 -0400 |
| commit | f26e77ba4088f20e72e13409f9ad535039abd291 (patch) | |
| tree | fa39e6c8bb57bfe5729854c8ea2bd3e25ea4155f /src/code/z_camera.c | |
| parent | 312b65d5e34878df4b70d8b9922e1082213b3662 (diff) | |
More General Cleanup (#1638)
* LINKER_FILES in makefile
* COLPOLY_GET_NORMAL
* math header
* libc
* M_PI for cosf and sinf files
* MAXFLOAT
* Revert "MAXFLOAT"
This reverts commit 96b75ffaa89b1a4ca1c08278b28bc3c70224701a.
* Remove SHT_MINV
* SHRT_MAX
* Add M_PI
* Angle macros
* f suffix
* Format
Diffstat (limited to 'src/code/z_camera.c')
| -rw-r--r-- | src/code/z_camera.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 609e035b1..ad2170d5f 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -45,7 +45,7 @@ #include "prevent_bss_reordering.h" #include "global.h" -#include "libc/string.h" +#include "string.h" #include "z64malloc.h" #include "z64quake.h" #include "z64shrink_window.h" @@ -1536,10 +1536,10 @@ s32 Camera_CalcAtForFriendlyLockOn(Camera* camera, VecGeo* eyeAtDir, Vec3f* targ deltaY = focalActorPosRot->pos.y - *yPosOffset; temp_f0_6 = Math_FAtan2F(deltaY, OLib_Vec3fDistXZ(at, &camera->eye)); - if (temp_f0_6 > 0.34906584f) { // (M_PI / 9) - phi_f16 = 1.0f - Math_SinF(temp_f0_6 - 0.34906584f); - } else if (temp_f0_6 < -0.17453292f) { // (M_PI / 18) - phi_f16 = 1.0f - Math_SinF(-0.17453292f - temp_f0_6); + if (temp_f0_6 > (f32)(M_PI / 9)) { + phi_f16 = 1.0f - Math_SinF(temp_f0_6 - (f32)(M_PI / 9)); + } else if (temp_f0_6 < -(f32)(M_PI / 18)) { + phi_f16 = 1.0f - Math_SinF(-(f32)(M_PI / 18) - temp_f0_6); } else { phi_f16 = 1.0f; } @@ -1616,10 +1616,10 @@ s32 Camera_CalcAtForEnemyLockOn(Camera* camera, VecGeo* arg1, Vec3f* arg2, f32 y focalActorAtOffsetTarget.y -= deltaY; } else { - if (temp_f0_3 > 0.34906584f) { // (M_PI / 9) - temp = 1.0f - Math_SinF(temp_f0_3 - 0.34906584f); - } else if (temp_f0_3 < -0.17453292f) { // (M_PI / 18) - temp = 1.0f - Math_SinF(-0.17453292f - temp_f0_3); + if (temp_f0_3 > (f32)(M_PI / 9)) { + temp = 1.0f - Math_SinF(temp_f0_3 - (f32)(M_PI / 9)); + } else if (temp_f0_3 < -(f32)(M_PI / 18)) { + temp = 1.0f - Math_SinF(-(f32)(M_PI / 18) - temp_f0_3); } else { temp = 1.0f; } |
