1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-13 19:35:28 +00:00

Doc/cleanup pass on effects 1 (#1421)

* Some doc/cleanup on `Effect_Ss_Fhg_Flash`

* Some doc/cleanup on `Effect_Ss_Blast`

* 11DA0 -> Billboard

* doc three lerp funcs in effectss

* Some doc/cleanup on `Effect_Ss_Bomb`

* `rTexIdx` -> `rTexIndex`

* lifespan

* `LIFESPAN` -> `EFFSSBOMB_LIFESPAN`

* --parentheses

* Add todo about "having zapd forward declare static variables"

* try rework comments on effects scale

* lightning -> "a ball of electrical arcs" ?
This commit is contained in:
Dragorn421 2023-08-16 02:28:12 +02:00 committed by GitHub
parent 4dea0bfb26
commit d6207b17c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 292 additions and 294 deletions

View file

@ -324,16 +324,25 @@ void EffectSs_DrawAll(PlayState* play) {
}
}
s16 func_80027DD4(s16 arg0, s16 arg1, s32 arg2) {
s16 ret = (arg2 == 0) ? arg1 : (arg0 + (s32)((arg1 - arg0) / (f32)arg2));
/**
* Lerp from `a` (weightInv == inf) to `b` (weightInv == 1 or 0).
*/
s16 EffectSs_LerpInv(s16 a, s16 b, s32 weightInv) {
s16 ret = (weightInv == 0) ? b : (a + (s32)((b - a) / (f32)weightInv));
return ret;
}
s16 func_80027E34(s16 arg0, s16 arg1, f32 arg2) {
return (arg1 - arg0) * arg2 + arg0;
/**
* Lerp from `a` (weight == 0) to `b` (weight == 1).
*/
s16 EffectSs_LerpS16(s16 a, s16 b, f32 weight) {
return (b - a) * weight + a;
}
u8 func_80027E84(u8 arg0, u8 arg1, f32 arg2) {
return arg2 * ((f32)arg1 - (f32)arg0) + arg0;
/**
* Lerp from `a` (weight == 0) to `b` (weight == 1).
*/
u8 EffectSs_LerpU8(u8 a, u8 b, f32 weight) {
return weight * ((f32)b - (f32)a) + a;
}