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

@ -112,7 +112,7 @@ void EnDha_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void func_809EC9C8(EnDha* this) {
SkelAnime_ChangeAnimDefaultRepeat(&this->skelAnime, &D_060015B0);
this->unk_1C0 = 0;
this->unk_1C8 = ((Math_Rand_ZeroOne() * 10.0f) + 5.0f);
this->unk_1C8 = ((Rand_ZeroOne() * 10.0f) + 5.0f);
this->actor.speedXZ = 0.0f;
this->actor.posRot.rot.y = this->actor.shape.rot.y;
this->actor.initPosRot.rot.z = 1;
@ -131,8 +131,8 @@ void func_809ECA50(EnDha* this, GlobalContext* globalCtx) {
s16 result;
s32 resultAbs;
playerPos.x += Math_Sins(player->actor.shape.rot.y) * -5.0f;
playerPos.z += Math_Coss(player->actor.shape.rot.y) * -5.0f;
playerPos.x += Math_SinS(player->actor.shape.rot.y) * -5.0f;
playerPos.z += Math_CosS(player->actor.shape.rot.y) * -5.0f;
if (LINK_IS_CHILD) {
playerPos.y += 38.0f;
} else {
@ -152,7 +152,7 @@ void func_809ECA50(EnDha* this, GlobalContext* globalCtx) {
}
} else {
this->unk_1CA += 0x1194;
this->unk_1D0.y = Math_Sins(this->unk_1CA) * 1820.0f;
this->unk_1D0.y = Math_SinS(this->unk_1CA) * 1820.0f;
if (!(player->stateFlags2 & 0x80)) {
this->unk_1CC = 0;
func_809ECF60(this);
@ -177,9 +177,9 @@ void func_809ECA50(EnDha* this, GlobalContext* globalCtx) {
}
}
this->actor.shape.rot.y = Math_Vec3f_Yaw(&this->actor.posRot.pos, &playerPos);
Math_SmoothScaleMaxMinF(&this->unk_1DC.x, playerPos.x, 1.0f, 16.0f, 0.0f);
Math_SmoothScaleMaxMinF(&this->unk_1DC.y, playerPos.y, 1.0f, 16.0f, 0.0f);
Math_SmoothScaleMaxMinF(&this->unk_1DC.z, playerPos.z, 1.0f, 16.0f, 0.0f);
Math_SmoothStepToF(&this->unk_1DC.x, playerPos.x, 1.0f, 16.0f, 0.0f);
Math_SmoothStepToF(&this->unk_1DC.y, playerPos.y, 1.0f, 16.0f, 0.0f);
Math_SmoothStepToF(&this->unk_1DC.z, playerPos.z, 1.0f, 16.0f, 0.0f);
func_80035844(&this->unk_1F4, &this->unk_1DC, &test, 0);
Matrix_Translate(this->unk_1DC.x, this->unk_1DC.y, this->unk_1DC.z, MTXMODE_NEW);
Matrix_RotateRPY(test.x, test.y, 0, MTXMODE_APPLY);
@ -206,8 +206,8 @@ void func_809ECA50(EnDha* this, GlobalContext* globalCtx) {
player->unk_850 = 200;
}
this->actor.initPosRot.rot.z = 1;
Math_SmoothScaleMaxMinS(&this->unk_1D0.x, 0, 1, 0x3E8, 0);
Math_SmoothScaleMaxMinS(&this->unk_1CE, -0x4000, 1, 0x3E8, 0);
Math_SmoothStepToS(&this->unk_1D0.x, 0, 1, 0x3E8, 0);
Math_SmoothStepToS(&this->unk_1CE, -0x4000, 1, 0x3E8, 0);
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
}
}
@ -225,9 +225,9 @@ void func_809ECF8C(EnDha* this, GlobalContext* globalCtx) {
player->actor.parent = NULL;
player->unk_850 = 200;
}
Math_SmoothScaleMaxMinS(&this->unk_1D0.x, 0, 1, 2000, 0);
Math_SmoothScaleMaxMinS(&this->unk_1D0.y, 0, 1, 600, 0);
Math_SmoothScaleMaxMinS(&this->unk_1CE, -0x4000, 1, 2000, 0);
Math_SmoothStepToS(&this->unk_1D0.x, 0, 1, 2000, 0);
Math_SmoothStepToS(&this->unk_1D0.y, 0, 1, 600, 0);
Math_SmoothStepToS(&this->unk_1CE, -0x4000, 1, 2000, 0);
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
this->unk_1C8--;
if (this->unk_1C8 == 0) {
@ -260,8 +260,8 @@ void EnDha_Die(EnDha* this, GlobalContext* globalCtx) {
player->actor.parent = NULL;
player->unk_850 = 200;
}
Math_SmoothScaleMaxMinS(&this->unk_1D0.x, 0, 1, 0x7D0, 0);
result = Math_SmoothScaleMaxMinS(&this->unk_1CE, -0x4000, 1, 0x7D0, 0);
Math_SmoothStepToS(&this->unk_1D0.x, 0, 1, 0x7D0, 0);
result = Math_SmoothStepToS(&this->unk_1CE, -0x4000, 1, 0x7D0, 0);
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
if (result == 0) {
vector = this->actor.posRot.pos;