1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-08 07:20:16 +00:00

Consistent naming for Math_ functions (#542)

* Darkmeiro decompilation

Bg_Gnd_Darkmeiro decompiled, matched, and documented.

* give this a shot

* fix conflict

* one more try

* could be useful

* whoops

* ZAP2 stuff

* ZAP why

* ZAP again

* maths

* Factoriali -> Factorial

* soon, soon

* renames

* rand

* docs

* merged

* formatting

* little more cleanup

* asm crept back in

* changes to MathF

* smooth criminal

* functions.h
This commit is contained in:
petrie911 2020-12-26 04:44:53 -06:00 committed by GitHub
parent 81c269b417
commit 8fa6cb6ff9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1329 changed files with 8413 additions and 8374 deletions

View file

@ -212,8 +212,8 @@ void EnOkuta_SetupFreeze(EnOkuta* this) {
void EnOkuta_SpawnProjectile(EnOkuta* this, GlobalContext* globalCtx) {
Vec3f pos;
Vec3f velocity;
f32 sin = Math_Sins(this->actor.shape.rot.y);
f32 cos = Math_Coss(this->actor.shape.rot.y);
f32 sin = Math_SinS(this->actor.shape.rot.y);
f32 cos = Math_CosS(this->actor.shape.rot.y);
pos.x = this->actor.posRot.pos.x + (25.0f * sin);
pos.y = this->actor.posRot.pos.y - 6.0f;
@ -266,7 +266,7 @@ void EnOkuta_Appear(EnOkuta* this, GlobalContext* globalCtx) {
void EnOkuta_Hide(EnOkuta* this, GlobalContext* globalCtx) {
s32 pad;
Math_SmoothScaleMaxF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 0.5f, 30.0f);
Math_ApproachF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 0.5f, 30.0f);
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_OCTAROCK_BUBLE);
EnOkuta_SpawnBubbles(this, globalCtx);
@ -299,7 +299,7 @@ void EnOkuta_WaitToShoot(EnOkuta* this, GlobalContext* globalCtx) {
if (this->actor.xzDistFromLink < 160.0f || this->actor.xzDistFromLink > 560.0f) {
EnOkuta_SetupHide(this);
} else {
temp_v0_2 = Math_SmoothScaleMaxMinS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, 0x71C, 0x38E);
temp_v0_2 = Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, 0x71C, 0x38E);
phi_v1 = ABS(temp_v0_2);
if ((phi_v1 < 0x38E) && (this->timer == 0) && (this->actor.yDistFromLink < 200.0f)) {
EnOkuta_SetupShoot(this, globalCtx);
@ -308,7 +308,7 @@ void EnOkuta_WaitToShoot(EnOkuta* this, GlobalContext* globalCtx) {
}
void EnOkuta_Shoot(EnOkuta* this, GlobalContext* globalCtx) {
Math_SmoothScaleMaxS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, 0x71C);
Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, 0x71C);
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
if (this->timer != 0) {
this->timer--;
@ -344,7 +344,7 @@ void EnOkuta_WaitToDie(EnOkuta* this, GlobalContext* globalCtx) {
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
EnOkuta_SetupDie(this);
}
Math_SmoothScaleMaxF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 0.5f, 5.0f);
Math_ApproachF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 0.5f, 5.0f);
}
void EnOkuta_Die(EnOkuta* this, GlobalContext* globalCtx) {
@ -358,7 +358,7 @@ void EnOkuta_Die(EnOkuta* this, GlobalContext* globalCtx) {
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
this->timer++;
}
Math_SmoothScaleMaxF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 0.5f, 5.0f);
Math_ApproachF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 0.5f, 5.0f);
if (this->timer == 5) {
pos.x = this->actor.posRot.pos.x;
pos.y = this->actor.posRot.pos.y + 40.0f;
@ -380,15 +380,15 @@ void EnOkuta_Die(EnOkuta* this, GlobalContext* globalCtx) {
} else if (this->timer < 11) {
Actor_SetScale(&this->actor, (((this->timer - 5) * 0.04f) + 0.8f) * 0.01f);
} else {
if (Math_ApproxF(&this->actor.scale.x, 0.0f, 0.0005f)) {
if (Math_StepToF(&this->actor.scale.x, 0.0f, 0.0005f)) {
Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 30, NA_SE_EN_OCTAROCK_BUBLE);
Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0x70);
for (i = 0; i < 20; i++) {
velocity.x = (Math_Rand_ZeroOne() - 0.5f) * 7.0f;
velocity.y = Math_Rand_ZeroOne() * 7.0f;
velocity.z = (Math_Rand_ZeroOne() - 0.5f) * 7.0f;
velocity.x = (Rand_ZeroOne() - 0.5f) * 7.0f;
velocity.y = Rand_ZeroOne() * 7.0f;
velocity.z = (Rand_ZeroOne() - 0.5f) * 7.0f;
EffectSsDtBubble_SpawnCustomColor(globalCtx, &this->actor.posRot.pos, &velocity, &accel, &primColor,
&envColor, Math_Rand_S16Offset(100, 50), 25, 0);
&envColor, Rand_S16Offset(100, 50), 25, 0);
}
Actor_Kill(&this->actor);
}
@ -412,9 +412,9 @@ void EnOkuta_Freeze(EnOkuta* this, GlobalContext* globalCtx) {
pos.x = this->actor.posRot.pos.x + ((temp_v1 & 2) ? 10.0f : -10.0f);
pos.z = this->actor.posRot.pos.z + ((temp_v1 & 1) ? 10.0f : -10.0f);
EffectSsEnIce_SpawnFlyingVec3f(globalCtx, &this->actor, &pos, 150, 150, 150, 250, 235, 245, 255,
(Math_Rand_ZeroOne() * 0.2f) + 1.9f);
(Rand_ZeroOne() * 0.2f) + 1.9f);
}
Math_SmoothScaleMaxF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 0.5f, 5.0f);
Math_ApproachF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 0.5f, 5.0f);
}
void EnOkuta_ProjectileFly(EnOkuta* this, GlobalContext* globalCtx) {