1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-04 15:04:31 +00:00

Clean up some float literals (#972)

* floats are fun

* more cleanup

* one more bit

* format

* merge kankyo

* Update src/overlays/actors/ovl_En_Horse/z_en_horse.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update src/overlays/actors/ovl_En_Mm/z_en_mm.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
This commit is contained in:
petrie911 2021-11-01 18:29:47 -05:00 committed by GitHub
parent 8e57f3bca3
commit cb43f256f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 352 additions and 347 deletions

View file

@ -79,7 +79,7 @@ void Audio_InitNoteSub(Note* note, NoteSubEu* sub, NoteSubAttributes* attrs) {
} else if (gAudioContext.soundMode == 3) {
sub->bitField0.s.stereoHeadsetEffects = false;
sub->bitField0.s.usesHeadsetPanEffects = false;
volLeft = 0.707f;
volLeft = 0.707f; // approx 1/sqrt(2)
volRight = 0.707f;
} else {
sub->bitField0.s.stereoStrongRight = sp24.strongRight;
@ -91,8 +91,8 @@ void Audio_InitNoteSub(Note* note, NoteSubEu* sub, NoteSubAttributes* attrs) {
vel = 0.0f > vel ? 0.0f : vel;
vel = 1.0f < vel ? 1.0f : vel;
sub->targetVolLeft = (s32)((vel * volLeft) * 4095.999f);
sub->targetVolRight = (s32)((vel * volRight) * 4095.999f);
sub->targetVolLeft = (s32)((vel * volLeft) * (0x1000 - 0.001f));
sub->targetVolRight = (s32)((vel * volRight) * (0x1000 - 0.001f));
sub->unk_2 = attrs->unk_1;
sub->filter = attrs->filter;

View file

@ -189,7 +189,7 @@ u8 sPrevOcarinaNoteVal = 0;
u8 sCurOcarinaBtnIdx = 0; // note index?
u8 sLearnSongLastBtn = 0;
f32 D_80130F24 = 1.0f;
f32 D_80130F28 = 0.68503934f;
f32 D_80130F28 = 87.0f / 127.0f;
s8 D_80130F2C = 0; // pitch?
s8 D_80130F30 = 0x57;
s8 D_80130F34 = 0;
@ -2783,16 +2783,16 @@ f32 func_800F3188(u8 bankIdx, u8 entryIdx) {
} else {
switch (bankEntry->sfxParams & 3) {
case 1:
phi_f0 = 666.6667f;
phi_f0 = 10000.0f / 15.0f;
break;
case 2:
phi_f0 = 952.381f;
phi_f0 = 10000.0f / 10.5f;
break;
case 3:
phi_f0 = 3846.154f;
phi_f0 = 10000.0f / 2.6f;
break;
default:
phi_f0 = 500.0f;
phi_f0 = 10000.0f / 20.0f;
break;
}
@ -2876,7 +2876,7 @@ s8 Audio_ComputeSoundPanSigned(f32 x, f32 z, u8 arg2) {
pan = 1.0f - pan;
}
} else {
pan = (x / (5.0769234f * absZ)) + 0.5f;
pan = (x / (5.0769234f * absZ)) + 0.5f; // about 66 / 13
}
if (absZ < 50.0f) {
@ -2982,9 +2982,9 @@ u8 func_800F37B8(f32 arg0, SoundBankEntry* arg1, s8 arg2) {
break;
}
phi_f12 = CLAMP_MAX(arg1->dist, 1923.077f);
phi_f12 = CLAMP_MAX(arg1->dist, 10000.0f / 5.2f);
return (phi_v1 * 0x10) + (u8)((phi_f0 * phi_f12) / 1923.077f);
return (phi_v1 * 0x10) + (u8)((phi_f0 * phi_f12) / (10000.0f / 5.2f));
}
s8 func_800F3990(f32 arg0, u16 sfxParams) {

View file

@ -289,7 +289,7 @@ void EffectBlure_UpdateFlags(EffectBlureElement* elem) {
Math3D_CosOut(&sp4C, &sp40, &sp2C)) {
elem->flags &= ~3;
elem->flags |= 0;
} else if ((sp34 <= -0.5f) || (sp30 <= -0.5f) || (sp2C <= 0.7071f)) {
} else if ((sp34 <= -0.5f) || (sp30 <= -0.5f) || (sp2C <= 0.7071f)) { // cos(45 degrees)
elem->flags &= ~3;
elem->flags |= 0;
} else {