mirror of
https://github.com/zeldaret/mm.git
synced 2026-05-29 08:42:51 -04:00
Rename tons of structs because we aren't using the z_ prefix anymore ;_;
This commit is contained in:
+40
-40
@@ -255,7 +255,7 @@ s16 Lib_randStride_s(s16 a0, s16 a1, s16 a2) {
|
||||
return (s16)(randZeroOne() * a2) * a1 + a0;
|
||||
}
|
||||
|
||||
UNK_RET Lib_CopyVec3f(z_Vector3f* dst, z_Vector3f* src) {
|
||||
UNK_RET Lib_CopyVec3f(Vector3f* dst, Vector3f* src) {
|
||||
f32 x = src->x;
|
||||
f32 y = src->y;
|
||||
f32 z = src->z;
|
||||
@@ -265,7 +265,7 @@ UNK_RET Lib_CopyVec3f(z_Vector3f* dst, z_Vector3f* src) {
|
||||
dst->z = z;
|
||||
}
|
||||
|
||||
UNK_RET Lib_CopyVec3s(z_Vector3s* dst, z_Vector3s* src) {
|
||||
UNK_RET Lib_CopyVec3s(Vector3s* dst, Vector3s* src) {
|
||||
s16 x = src->x;
|
||||
s16 y = src->y;
|
||||
s16 z = src->z;
|
||||
@@ -275,7 +275,7 @@ UNK_RET Lib_CopyVec3s(z_Vector3s* dst, z_Vector3s* src) {
|
||||
dst->z = z;
|
||||
}
|
||||
|
||||
UNK_RET Lib_ToVec3f(z_Vector3f* dst, z_Vector3s* src) {
|
||||
UNK_RET Lib_ToVec3f(Vector3f* dst, Vector3s* src) {
|
||||
f32 x = src->x;
|
||||
f32 y = src->y;
|
||||
f32 z = src->z;
|
||||
@@ -285,7 +285,7 @@ UNK_RET Lib_ToVec3f(z_Vector3f* dst, z_Vector3s* src) {
|
||||
dst->z = z;
|
||||
}
|
||||
|
||||
UNK_RET Lib_ToVec3s(z_Vector3s* dst, z_Vector3f* src) {
|
||||
UNK_RET Lib_ToVec3s(Vector3s* dst, Vector3f* src) {
|
||||
f32 x = src->x;
|
||||
f32 y = src->y;
|
||||
f32 z = src->z;
|
||||
@@ -295,55 +295,55 @@ UNK_RET Lib_ToVec3s(z_Vector3s* dst, z_Vector3f* src) {
|
||||
dst->z = z;
|
||||
}
|
||||
|
||||
UNK_RET Lib_AddVec3f(z_Vector3f* a0, z_Vector3f* a1, z_Vector3f* a2) {
|
||||
UNK_RET Lib_AddVec3f(Vector3f* a0, Vector3f* a1, Vector3f* a2) {
|
||||
a2->x = a0->x + a1->x;
|
||||
a2->y = a0->y + a1->y;
|
||||
a2->z = a0->z + a1->z;
|
||||
}
|
||||
|
||||
UNK_RET Lib_SubVec3f(z_Vector3f* a0, z_Vector3f* a1, z_Vector3f* a2) {
|
||||
UNK_RET Lib_SubVec3f(Vector3f* a0, Vector3f* a1, Vector3f* a2) {
|
||||
a2->x = a0->x - a1->x;
|
||||
a2->y = a0->y - a1->y;
|
||||
a2->z = a0->z - a1->z;
|
||||
}
|
||||
|
||||
UNK_RET Lib_SubVec3sToVec3f(z_Vector3f* a0, z_Vector3s* a1, z_Vector3s* a2) {
|
||||
UNK_RET Lib_SubVec3sToVec3f(Vector3f* a0, Vector3s* a1, Vector3s* a2) {
|
||||
a0->x = a1->x - a2->x;
|
||||
a0->y = a1->y - a2->y;
|
||||
a0->z = a1->z - a2->z;
|
||||
}
|
||||
|
||||
UNK_RET Lib_ScaleInPlaceVec3f(z_Vector3f* a0, f32 a1) {
|
||||
UNK_RET Lib_ScaleInPlaceVec3f(Vector3f* a0, f32 a1) {
|
||||
a0->x *= a1;
|
||||
a0->y *= a1;
|
||||
a0->z *= a1;
|
||||
}
|
||||
|
||||
UNK_RET Lib_ScaleVec3f(z_Vector3f* a0, f32 a1, z_Vector3f* a2) {
|
||||
UNK_RET Lib_ScaleVec3f(Vector3f* a0, f32 a1, Vector3f* a2) {
|
||||
a2->x = a0->x * a1;
|
||||
a2->y = a0->y * a1;
|
||||
a2->z = a0->z * a1;
|
||||
}
|
||||
|
||||
UNK_RET Lib_LerpVec3f(z_Vector3f* a0, z_Vector3f* a1, f32 a2, z_Vector3f* a3) {
|
||||
UNK_RET Lib_LerpVec3f(Vector3f* a0, Vector3f* a1, f32 a2, Vector3f* a3) {
|
||||
a3->x = (a1->x - a0->x) * a2 + a0->x;
|
||||
a3->y = (a1->y - a0->y) * a2 + a0->y;
|
||||
a3->z = (a1->z - a0->z) * a2 + a0->z;
|
||||
}
|
||||
|
||||
UNK_RET Lib_AddScaledVec3f(z_Vector3f* a0, z_Vector3f* a1, f32 a2, z_Vector3f* a3) {
|
||||
UNK_RET Lib_AddScaledVec3f(Vector3f* a0, Vector3f* a1, f32 a2, Vector3f* a3) {
|
||||
a3->x = a1->x * a2 + a0->x;
|
||||
a3->y = a1->y * a2 + a0->y;
|
||||
a3->z = a1->z * a2 + a0->z;
|
||||
}
|
||||
|
||||
UNK_RET Lib_ModifyRandScaled(z_Vector3f* a0, f32 a1, z_Vector3f* a2) {
|
||||
UNK_RET Lib_ModifyRandScaled(Vector3f* a0, f32 a1, Vector3f* a2) {
|
||||
a2->x = randPlusMinusPoint5Scaled(a1) + a0->x;
|
||||
a2->y = randPlusMinusPoint5Scaled(a1) + a0->y;
|
||||
a2->z = randPlusMinusPoint5Scaled(a1) + a0->z;
|
||||
}
|
||||
|
||||
void Lib_ScaledNormalizedDifferenceVec3f(z_Vector3f* a0, z_Vector3f* a1, f32 a2, z_Vector3f* a3) {
|
||||
void Lib_ScaledNormalizedDifferenceVec3f(Vector3f* a0, Vector3f* a1, f32 a2, Vector3f* a3) {
|
||||
f32 f0 = Lib_DistanceAndDifferenceVec3f(a0, a1, a3);
|
||||
f32 f2;
|
||||
|
||||
@@ -358,24 +358,24 @@ void Lib_ScaledNormalizedDifferenceVec3f(z_Vector3f* a0, z_Vector3f* a1, f32 a2,
|
||||
a3->z *= f2;
|
||||
}
|
||||
|
||||
f32 Lib_DistanceVec3f(z_Vector3f* a0, z_Vector3f* a1) {
|
||||
z_Vector3f sp1C;
|
||||
f32 Lib_DistanceVec3f(Vector3f* a0, Vector3f* a1) {
|
||||
Vector3f sp1C;
|
||||
Lib_SubVec3f(a1, a0, &sp1C);
|
||||
return sqrtf((sp1C.x * sp1C.x) + (sp1C.y * sp1C.y) + (sp1C.z * sp1C.z));
|
||||
}
|
||||
|
||||
f32 Lib_DistanceAndDifferenceVec3f(z_Vector3f* a0, z_Vector3f* a1, z_Vector3f* a2) {
|
||||
f32 Lib_DistanceAndDifferenceVec3f(Vector3f* a0, Vector3f* a1, Vector3f* a2) {
|
||||
Lib_SubVec3f(a1, a0, a2);
|
||||
return sqrtf((a2->x * a2->x) + (a2->y * a2->y) + (a2->z * a2->z));
|
||||
}
|
||||
|
||||
f32 Lib_DistanceXZVec3f(z_Vector3f* a0, z_Vector3f* a1) {
|
||||
f32 Lib_DistanceXZVec3f(Vector3f* a0, Vector3f* a1) {
|
||||
f32 dx = a1->x - a0->x;
|
||||
f32 dz = a1->z - a0->z;
|
||||
return sqrtf((dx * dx) + (dz * dz));
|
||||
}
|
||||
|
||||
f32 Lib_DistanceAndDifferenceXZVec3f(z_Vector3f* a0, z_Vector3f* a1, f32* a2, f32* a3) {
|
||||
f32 Lib_DistanceAndDifferenceXZVec3f(Vector3f* a0, Vector3f* a1, f32* a2, f32* a3) {
|
||||
*a2 = a1->x - a0->x;
|
||||
*a3 = a1->z - a0->z;
|
||||
return sqrtf((*a2 * *a2) + (*a3 * *a3));
|
||||
@@ -383,7 +383,7 @@ f32 Lib_DistanceAndDifferenceXZVec3f(z_Vector3f* a0, z_Vector3f* a1, f32* a2, f3
|
||||
|
||||
#ifdef NONMATCHING
|
||||
|
||||
UNK_RET Lib_PushAwayXZVec3f(z_Vector3f* a0, z_Vector3f* a1, f32 a2) {
|
||||
UNK_RET Lib_PushAwayXZVec3f(Vector3f* a0, Vector3f* a1, f32 a2) {
|
||||
f32 sp24;
|
||||
f32 sp20;
|
||||
f32 f0 = Lib_DistanceAndDifferenceXZVec3f(a1, a0, &sp24, &sp20);
|
||||
@@ -405,60 +405,60 @@ GLOBAL_ASM("./asm/nonmatching/z_lib/Lib_PushAwayXZVec3f.asm")
|
||||
|
||||
#endif
|
||||
|
||||
f32 Lib_DistanceYVec3f(z_Vector3f* a0, z_Vector3f* a1) {
|
||||
f32 Lib_DistanceYVec3f(Vector3f* a0, Vector3f* a1) {
|
||||
return a1->y - a0->y;
|
||||
}
|
||||
|
||||
UNK_TYPE Lib_YawVec3f(z_Vector3f* a0, z_Vector3f* a1) {
|
||||
UNK_TYPE Lib_YawVec3f(Vector3f* a0, Vector3f* a1) {
|
||||
f32 f14 = a1->x - a0->x;
|
||||
f32 f12 = a1->z - a0->z;
|
||||
return atans_flip(f12, f14);
|
||||
}
|
||||
|
||||
UNK_TYPE Lib_PitchVec3f(z_Vector3f* a0, z_Vector3f* a1) {
|
||||
UNK_TYPE Lib_PitchVec3f(Vector3f* a0, Vector3f* a1) {
|
||||
return atans_flip(Lib_DistanceXZVec3f(a0, a1), a0->y - a1->y);
|
||||
}
|
||||
|
||||
void Lib_ApplyActorInitVars(z_Actor* a0, z_ActorInitVar* a1) {
|
||||
void Lib_ApplyActorInitVars(Actor* a0, ActorInitVar* a1) {
|
||||
do {
|
||||
D_801BE960[a1->type]((u8*)a0, a1);
|
||||
} while ((a1++)->cont);
|
||||
}
|
||||
|
||||
UNK_RET Lib_ApplyActorInitVarByte1(u8* a0, z_ActorInitVar* a1) {
|
||||
UNK_RET Lib_ApplyActorInitVarByte1(u8* a0, ActorInitVar* a1) {
|
||||
*(u8*)(a0 + a1->offset) = (u8)(a1->value);
|
||||
}
|
||||
|
||||
UNK_RET Lib_ApplyActorInitVarByte2(u8* a0, z_ActorInitVar* a1) {
|
||||
UNK_RET Lib_ApplyActorInitVarByte2(u8* a0, ActorInitVar* a1) {
|
||||
*(u8*)(a0 + a1->offset) = (u8)(a1->value);
|
||||
}
|
||||
|
||||
UNK_RET Lib_ApplyActorInitVarShort1(u8* a0, z_ActorInitVar* a1) {
|
||||
UNK_RET Lib_ApplyActorInitVarShort1(u8* a0, ActorInitVar* a1) {
|
||||
*(u16*)(a0 + a1->offset) = (u16)(a1->value);
|
||||
}
|
||||
|
||||
UNK_RET Lib_ApplyActorInitVarShort2(u8* a0, z_ActorInitVar* a1) {
|
||||
UNK_RET Lib_ApplyActorInitVarShort2(u8* a0, ActorInitVar* a1) {
|
||||
*(u16*)(a0 + a1->offset) = (u16)(a1->value);
|
||||
}
|
||||
|
||||
UNK_RET Lib_ApplyActorInitVarWord1(u8* a0, z_ActorInitVar* a1) {
|
||||
UNK_RET Lib_ApplyActorInitVarWord1(u8* a0, ActorInitVar* a1) {
|
||||
*(u32*)(a0 + a1->offset) = (u32)(a1->value);
|
||||
}
|
||||
|
||||
UNK_RET Lib_ApplyActorInitVarWord2(u8* a0, z_ActorInitVar* a1) {
|
||||
UNK_RET Lib_ApplyActorInitVarWord2(u8* a0, ActorInitVar* a1) {
|
||||
*(u32*)(a0 + a1->offset) = (u32)(a1->value);
|
||||
}
|
||||
|
||||
UNK_RET Lib_ApplyActorInitVarFloat(u8* a0, z_ActorInitVar* a1) {
|
||||
UNK_RET Lib_ApplyActorInitVarFloat(u8* a0, ActorInitVar* a1) {
|
||||
*(f32*)(a0 + a1->offset) = (f32)(a1->value);
|
||||
}
|
||||
|
||||
UNK_RET Lib_ApplyActorInitVarFloat1000th(u8* a0, z_ActorInitVar* a1) {
|
||||
UNK_RET Lib_ApplyActorInitVarFloat1000th(u8* a0, ActorInitVar* a1) {
|
||||
*(f32*)(a0 + a1->offset) = (f32)(a1->value) / 1000;
|
||||
}
|
||||
|
||||
UNK_RET Lib_ApplyActorInitVarVector3f(u8* a0, z_ActorInitVar* a1) {
|
||||
z_Vector3f* v0 = (z_Vector3f*)(a0 + a1->offset);
|
||||
UNK_RET Lib_ApplyActorInitVarVector3f(u8* a0, ActorInitVar* a1) {
|
||||
Vector3f* v0 = (Vector3f*)(a0 + a1->offset);
|
||||
f32 f0 = (f32)(a1->value);
|
||||
|
||||
v0->z = f0;
|
||||
@@ -466,8 +466,8 @@ UNK_RET Lib_ApplyActorInitVarVector3f(u8* a0, z_ActorInitVar* a1) {
|
||||
v0->x = f0;
|
||||
}
|
||||
|
||||
UNK_RET Lib_ApplyActorInitVarVector3f1000th(u8* a0, z_ActorInitVar* a1) {
|
||||
z_Vector3f* v0 = (z_Vector3f*)(a0 + a1->offset);
|
||||
UNK_RET Lib_ApplyActorInitVarVector3f1000th(u8* a0, ActorInitVar* a1) {
|
||||
Vector3f* v0 = (Vector3f*)(a0 + a1->offset);
|
||||
f32 f0 = (f32)(a1->value) / 1000;
|
||||
|
||||
v0->z = f0;
|
||||
@@ -475,8 +475,8 @@ UNK_RET Lib_ApplyActorInitVarVector3f1000th(u8* a0, z_ActorInitVar* a1) {
|
||||
v0->x = f0;
|
||||
}
|
||||
|
||||
UNK_RET Lib_ApplyActorInitVarVector3s(u8* a0, z_ActorInitVar* a1) {
|
||||
z_Vector3s* v0 = (z_Vector3s*)(a0 + a1->offset);
|
||||
UNK_RET Lib_ApplyActorInitVarVector3s(u8* a0, ActorInitVar* a1) {
|
||||
Vector3s* v0 = (Vector3s*)(a0 + a1->offset);
|
||||
s16 v1 = (s16)(a1->value);
|
||||
|
||||
v0->z = v1;
|
||||
@@ -600,7 +600,7 @@ UNK_RET func_801000F4(UNK_TYPE a0, u16 a1) {
|
||||
func_8019F1C0(a0, a1);
|
||||
}
|
||||
|
||||
void Lib_TranslateAndRotateYVec3f(z_Vector3f* a0, s16 a1, z_Vector3f* a2, z_Vector3f* a3) {
|
||||
void Lib_TranslateAndRotateYVec3f(Vector3f* a0, s16 a1, Vector3f* a2, Vector3f* a3) {
|
||||
f32 sp1C;
|
||||
f32 f0;
|
||||
|
||||
@@ -626,8 +626,8 @@ GLOBAL_ASM("./asm/nonmatching/z_lib/Lib_LerpRGB.asm")
|
||||
|
||||
#endif
|
||||
|
||||
f32 Lib_PushAwayVec3f(z_Vector3f* a0, z_Vector3f* a1, f32 a2) {
|
||||
z_Vector3f sp24;
|
||||
f32 Lib_PushAwayVec3f(Vector3f* a0, Vector3f* a1, f32 a2) {
|
||||
Vector3f sp24;
|
||||
f32 f2;
|
||||
f32 f0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user