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

@ -24,17 +24,16 @@ extern Gfx D_0401A160[];
u32 EffectSsBubble_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, void* initParamsx) {
EffectSsBubbleInitParams* initParams = (EffectSsBubbleInitParams*)initParamsx;
// @bug Math_Rand_ZeroOne in the macro means a random number is generated for both parts of the macro.
// @bug Rand_ZeroOne in the macro means a random number is generated for both parts of the macro.
// In the base game this works out because both addresses are segment 4, but it may break if
// the addresses were changed to refer to different segments
this->gfx = SEGMENTED_TO_VIRTUAL(Math_Rand_ZeroOne() < 0.5f ? &D_04055DB0 : &D_04055EB0);
this->pos.x = ((Math_Rand_ZeroOne() - 0.5f) * initParams->xzPosRandScale) + initParams->pos.x;
this->pos.y =
(((Math_Rand_ZeroOne() - 0.5f) * initParams->yPosRandScale) + initParams->yPosOffset) + initParams->pos.y;
this->pos.z = ((Math_Rand_ZeroOne() - 0.5f) * initParams->xzPosRandScale) + initParams->pos.z;
this->gfx = SEGMENTED_TO_VIRTUAL(Rand_ZeroOne() < 0.5f ? &D_04055DB0 : &D_04055EB0);
this->pos.x = ((Rand_ZeroOne() - 0.5f) * initParams->xzPosRandScale) + initParams->pos.x;
this->pos.y = (((Rand_ZeroOne() - 0.5f) * initParams->yPosRandScale) + initParams->yPosOffset) + initParams->pos.y;
this->pos.z = ((Rand_ZeroOne() - 0.5f) * initParams->xzPosRandScale) + initParams->pos.z;
Math_Vec3f_Copy(&this->vec, &this->pos);
this->life = 1;
this->rScale = (((Math_Rand_ZeroOne() * 0.5f) + 1.0f) * initParams->scale) * 100;
this->rScale = (((Rand_ZeroOne() * 0.5f) + 1.0f) * initParams->scale) * 100;
this->draw = EffectSsBubble_Draw;
this->update = EffectSsBubble_Update;
@ -81,8 +80,8 @@ void EffectSsBubble_Update(GlobalContext* globalCtx, u32 index, EffectSs* this)
this->life = -1;
} else {
this->life++;
this->pos.x = ((Math_Rand_ZeroOne() * 0.5f) - 0.25f) + this->vec.x;
this->accel.y = (Math_Rand_ZeroOne() - 0.3f) * 0.2f;
this->pos.z = ((Math_Rand_ZeroOne() * 0.5f) - 0.25f) + this->vec.z;
this->pos.x = ((Rand_ZeroOne() * 0.5f) - 0.25f) + this->vec.x;
this->accel.y = (Rand_ZeroOne() - 0.3f) * 0.2f;
this->pos.z = ((Rand_ZeroOne() * 0.5f) - 0.25f) + this->vec.z;
}
}