diff --git a/soh/soh/Enhancements/randomizer/draw.cpp b/soh/soh/Enhancements/randomizer/draw.cpp index 3e02dd265..b9cc0b10b 100644 --- a/soh/soh/Enhancements/randomizer/draw.cpp +++ b/soh/soh/Enhancements/randomizer/draw.cpp @@ -597,7 +597,7 @@ extern "C" s32 OverrideLimbDrawBarinade(PlayState* play, s32 limbIndex, Gfx** dL (uintptr_t)Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 8, 16, 1, 0, (play->gameplayFrames * -2) % 64, 16, 16)); gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 200); - Matrix_RotateX(static_cast(-M_PI / 2), MTXMODE_APPLY); + Matrix_RotateX(-M_PIf / 2.0f, MTXMODE_APPLY); } else if ((limbIndex >= 10) && (limbIndex < 20)) { rot->x -= 0x4000; *dList = NULL; @@ -1126,8 +1126,8 @@ extern "C" void Randomizer_DrawFishingPoleGI(PlayState* play, GetItemEntry* getI Matrix_Scale(5.0f, 5.0f, 5.0f, MTXMODE_APPLY); pos = { 0.0f, -25.5f, -4.0f }; Matrix_Translate(pos.x, pos.y, pos.z, MTXMODE_APPLY); - Matrix_RotateZ(static_cast(-M_PI_2), MTXMODE_APPLY); - Matrix_RotateY(static_cast(-M_PI_2) - 0.2f, MTXMODE_APPLY); + Matrix_RotateZ(-M_PI_2f, MTXMODE_APPLY); + Matrix_RotateY(-M_PI_2f - 0.2f, MTXMODE_APPLY); Matrix_Scale(0.006f, 0.006f, 0.006f, MTXMODE_APPLY); Gfx_SetupDL_25Opa(play->state.gfxCtx); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__), @@ -1140,7 +1140,7 @@ extern "C" void Randomizer_DrawFishingPoleGI(PlayState* play, GetItemEntry* getI gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, (Gfx*)gFishingLureHookDL); - Matrix_RotateZ(static_cast(M_PI_2), MTXMODE_APPLY); + Matrix_RotateZ(M_PI_2f, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, (Gfx*)gFishingLureHookDL); @@ -1149,7 +1149,7 @@ extern "C" void Randomizer_DrawFishingPoleGI(PlayState* play, GetItemEntry* getI gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, (Gfx*)gFishingLureHookDL); - Matrix_RotateZ(static_cast(M_PI / 2), MTXMODE_APPLY); + Matrix_RotateZ(M_PIf / 2.0f, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, (Gfx*)gFishingLureHookDL); diff --git a/soh/soh/OTRGlobals.h b/soh/soh/OTRGlobals.h index 6f83d78ad..2d1464e47 100644 --- a/soh/soh/OTRGlobals.h +++ b/soh/soh/OTRGlobals.h @@ -15,6 +15,11 @@ #define BTN_CUSTOM_OCARINA_PITCH_UP ((CONTROLLERBUTTONS_T)0x00400000) #define BTN_CUSTOM_OCARINA_PITCH_DOWN ((CONTROLLERBUTTONS_T)0x00800000) +#define M_PIf 3.14159265358979323846f +#define M_PI_2f 1.57079632679489661923f // pi/2 +#define M_SQRT2f 1.41421356237309504880f +#define M_SQRT1_2f 0.70710678118654752440f /* 1/sqrt(2) */ + #ifdef __cplusplus #include #include "Enhancements/savestates.h"