summaryrefslogtreecommitdiff
path: root/src/code/z_player_lib.c
diff options
context:
space:
mode:
authorengineer124 <engineer124engineer124@gmail.com>2023-06-11 01:34:53 +1000
committerengineer124 <engineer124engineer124@gmail.com>2023-06-11 01:34:53 +1000
commit5fc0024b72622125a689aa5ae080337fe578f1ff (patch)
tree656ce93b5d46e86ed453980019f2110c877dd869 /src/code/z_player_lib.c
parent3dd8096af5af84fab0cd3a664d3e1e888224274d (diff)
parent47be99fb0cde762466ab8dd7d2471dd278a59040 (diff)
Merge branch 'master' into parameter
Diffstat (limited to 'src/code/z_player_lib.c')
-rw-r--r--src/code/z_player_lib.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c
index ced41e15d..eb821c0cb 100644
--- a/src/code/z_player_lib.c
+++ b/src/code/z_player_lib.c
@@ -270,7 +270,7 @@ void func_80122C20(PlayState* play, struct_80122D44_arg1* arg1) {
typedef struct {
/* 0x0 */ Color_RGB8 color;
/* 0x4 */ Gfx* dList;
-} struct_801BFDD0; // size = 0x08
+} struct_801BFDD0; // size = 0x8
struct_801BFDD0 D_801BFDD0[] = {
{ { 180, 200, 255 }, gLinkGoronCurledDL },
@@ -1540,10 +1540,8 @@ void Player_UpdateBunnyEars(Player* player) {
sBunnyEarKinematics.angVel.y += -sBunnyEarKinematics.rot.y >> 2;
angle = player->actor.world.rot.y - player->actor.shape.rot.y;
- force.x =
- (s32)(player->actor.speed * -200.0f * Math_CosS(angle) * (randPlusMinusPoint5Scaled(2.0f) + 10.0f)) & 0xFFFF;
- force.y =
- (s32)(player->actor.speed * 100.0f * Math_SinS(angle) * (randPlusMinusPoint5Scaled(2.0f) + 10.0f)) & 0xFFFF;
+ force.x = (s32)(player->actor.speed * -200.0f * Math_CosS(angle) * (Rand_CenteredFloat(2.0f) + 10.0f)) & 0xFFFF;
+ force.y = (s32)(player->actor.speed * 100.0f * Math_SinS(angle) * (Rand_CenteredFloat(2.0f) + 10.0f)) & 0xFFFF;
sBunnyEarKinematics.angVel.x += force.x >> 2;
sBunnyEarKinematics.angVel.y += force.y >> 2;
@@ -1643,9 +1641,9 @@ TexturePtr sPlayerMouthTextures[PLAYER_MOUTH_MAX] = {
};
typedef struct PlayerFaceIndices {
- /* 0x00 */ u8 eyeIndex;
- /* 0x01 */ u8 mouthIndex;
-} PlayerFaceIndices; // size = 0x02
+ /* 0x0 */ u8 eyeIndex;
+ /* 0x1 */ u8 mouthIndex;
+} PlayerFaceIndices; // size = 0x2
PlayerFaceIndices sPlayerFaces[] = {
{ PLAYER_EYES_OPEN, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_0
@@ -1801,7 +1799,7 @@ void Player_AdjustSingleLeg(PlayState* play, Player* player, SkelAnime* skelAnim
temp_f20 = sp74 - SQ(sp58);
temp_f20 = (temp_f20 < 0.0f) ? 0.0f : sqrtf(temp_f20);
- sp4C = func_80086B30(temp_f20, sp58);
+ sp4C = Math_FAtan2F(temp_f20, sp58);
distance = sqrtf(SQ(diffX) + SQ(yIntersect - sp90.y) + SQ(diffZ));
sp58 = (SQ(distance) + sp70) / (2.0f * distance);
sp54 = distance - sp58;
@@ -1809,8 +1807,8 @@ void Player_AdjustSingleLeg(PlayState* play, Player* player, SkelAnime* skelAnim
temp_f20 = sp74 - SQ(sp58);
temp_f20 = (temp_f20 < 0.0f) ? 0.0f : sqrtf(temp_f20);
- sp48 = func_80086B30(temp_f20, sp58);
- phi_t1 = (M_PI - (func_80086B30(sp54, temp_f20) + ((M_PI / 2.0f) - sp48))) * (0x8000 / M_PI);
+ sp48 = Math_FAtan2F(temp_f20, sp58);
+ phi_t1 = (M_PI - (Math_FAtan2F(sp54, temp_f20) + ((M_PI / 2.0f) - sp48))) * (0x8000 / M_PI);
phi_t1 = -skelAnime->jointTable[shinLimbIndex].z + phi_t1;
temp_f8 = (sp48 - sp4C) * (0x8000 / M_PI);