1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-20 14:01:15 +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

@ -143,7 +143,7 @@ void EnVm_Wait(EnVm* this, GlobalContext* globalCtx) {
switch (this->unk_25E) {
case 0:
Math_SmoothScaleMaxMinS(&this->beamRot.x, 0, 10, 1500, 0);
Math_SmoothStepToS(&this->beamRot.x, 0, 10, 1500, 0);
headRot = this->actor.yawTowardsLink - this->headRotY - this->actor.shape.rot.y;
pitch = Math_Vec3f_Pitch(&this->beamPos1, &player->actor.posRot.pos);
@ -155,8 +155,8 @@ void EnVm_Wait(EnVm* this, GlobalContext* globalCtx) {
if (this->actor.xzDistFromLink <= this->beamSightRange && ABS(headRot) <= 0x2710 && pitch >= 0xE38 &&
this->actor.yDistFromLink <= 80.0f && this->actor.yDistFromLink >= -160.0f) {
Math_SmoothScaleMaxMinS(&this->beamRot, pitch, 10, 0xFA0, 0);
if (Math_SmoothScaleMaxMinS(&this->headRotY, this->actor.yawTowardsLink - this->actor.shape.rot.y, 1,
Math_SmoothStepToS(&this->beamRot, pitch, 10, 0xFA0, 0);
if (Math_SmoothStepToS(&this->headRotY, this->actor.yawTowardsLink - this->actor.shape.rot.y, 1,
(ABS((s16)(dist * 180.0f)) / 3) + 0xFA0, 0) <= 5460) {
this->timer--;
if (this->timer == 0) {
@ -179,7 +179,7 @@ void EnVm_Wait(EnVm* this, GlobalContext* globalCtx) {
return;
}
Math_SmoothScaleMaxMinS(&this->headRotY, this->actor.yawTowardsLink - this->actor.shape.rot.y, 1, 0x1F40, 0);
Math_SmoothStepToS(&this->headRotY, this->actor.yawTowardsLink - this->actor.shape.rot.y, 1, 0x1F40, 0);
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
this->unk_260++;
@ -238,7 +238,7 @@ void EnVm_Attack(EnVm* this, GlobalContext* globalCtx) {
}
if (this->beamRot.x < 0xAAA || this->timer == 0) {
Math_SmoothScaleMaxMinF(&this->beamScale, 0.0f, 1.0f, 0.03f, 0.0f);
Math_SmoothStepToF(&this->beamScale, 0.0f, 1.0f, 0.03f, 0.0f);
this->unk_260 = 0;
if (this->beamScale.x == 0.0f) {
@ -251,9 +251,9 @@ void EnVm_Attack(EnVm* this, GlobalContext* globalCtx) {
return;
}
Math_SmoothScaleMaxMinS(&this->headRotY, -this->actor.shape.rot.y + this->actor.yawTowardsLink, 10, 0xDAC, 0);
Math_SmoothScaleMaxMinS(&this->beamRot.y, this->actor.yawTowardsLink, 10, 0xDAC, 0);
Math_SmoothScaleMaxMinS(&this->beamRot, pitch, 10, 0xDAC, 0);
Math_SmoothStepToS(&this->headRotY, -this->actor.shape.rot.y + this->actor.yawTowardsLink, 10, 0xDAC, 0);
Math_SmoothStepToS(&this->beamRot.y, this->actor.yawTowardsLink, 10, 0xDAC, 0);
Math_SmoothStepToS(&this->beamRot, pitch, 10, 0xDAC, 0);
playerPos = player->actor.posRot.pos;
if (player->actor.groundY > -32000.0f) {
@ -261,8 +261,8 @@ void EnVm_Attack(EnVm* this, GlobalContext* globalCtx) {
}
dist = Math_Vec3f_DistXYZ(&this->beamPos1, &playerPos);
Math_SmoothScaleMaxMinF(&this->beamScale.z, dist, 1.0f, this->beamSpeed, 0.0f);
Math_SmoothScaleMaxMinF(&this->beamScale.x, 0.1f, 1.0f, 0.12f, 0.0f);
Math_SmoothStepToF(&this->beamScale.z, dist, 1.0f, this->beamSpeed, 0.0f);
Math_SmoothStepToF(&this->beamScale.x, 0.1f, 1.0f, 0.12f, 0.0f);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_BIMOS_LAZER - SFX_FLAG);
if (this->unk_260 > 2) {
@ -305,7 +305,7 @@ void EnVm_Stun(EnVm* this, GlobalContext* globalCtx) {
}
}
} else {
Math_SmoothScaleMaxMinS(&this->beamRot, 0, 10, 0x5DC, 0);
Math_SmoothStepToS(&this->beamRot, 0, 10, 0x5DC, 0);
this->timer--;
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
}
@ -322,8 +322,8 @@ void EnVm_SetupDie(EnVm* this) {
this->actor.posRot.pos.y += 5000.0f * this->actor.scale.y;
this->actor.velocity.y = 8.0f;
this->actor.gravity = -0.5f;
this->actor.speedXZ = Math_Rand_ZeroOne() + 1.0f;
this->actor.posRot.rot.y = Math_Rand_CenteredFloat(65535.0f);
this->actor.speedXZ = Rand_ZeroOne() + 1.0f;
this->actor.posRot.rot.y = Rand_CenteredFloat(65535.0f);
EnVm_SetupAction(this, EnVm_Die);
}