diff options
| author | Prakxo <87568477+Prakxo@users.noreply.github.com> | 2024-08-13 23:34:26 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-13 14:34:26 -0700 |
| commit | 0f475e88a8ff441bd849bc94b2f8d5a65480a5a0 (patch) | |
| tree | 8e95e851dcd077335e381eaf1fb6ace4ff4fcf4c /src/code | |
| parent | eb99af89c88005c8e300b76e1b5d93467b98aafd (diff) | |
Extend usage of mTM_TIME_TO_SEC (#208)
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/m_actor_shadow.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/code/m_actor_shadow.c b/src/code/m_actor_shadow.c index 0856920..99741da 100644 --- a/src/code/m_actor_shadow.c +++ b/src/code/m_actor_shadow.c @@ -4,6 +4,7 @@ #include "macros.h" #include "sys_math3d.h" #include "m_field_info.h" +#include "m_time.h" extern Gfx ef_shadow_out_modelT[]; extern Gfx ef_shadow_in_modelT[]; @@ -50,19 +51,16 @@ void mActorShadow_GetTimeAngleY_TimeAlpha(ShadowInfo* shadow, Game_Play* play) { f32 angle; shadow->unk1C = play->kankyo.shadowAlpha; - // Between 4 a.m and 8 p.m - if ((timesec >= 14400) && (timesec < 72000)) { + if ((timesec >= mTM_TIME_TO_SEC(4, 0, 0)) && (timesec < mTM_TIME_TO_SEC(20, 0, 0))) { UNUSED f32 scopedTemp; - timef = (timesec - 14400) / 57600.0f; + timef = (timesec - mTM_TIME_TO_SEC(4, 0, 0)) / (f32)mTM_TIME_TO_SEC(16, 0, 0); angle = 16384; - } // Between 12 a.m and 4 a.m - else if (timesec < 14400) { + } else if (timesec < mTM_TIME_TO_SEC(4, 0, 0)) { UNUSED f32 scopedTemp; - timef = 0.5f + timesec / 28800.0f; + timef = 0.5f + timesec / (f32)mTM_TIME_TO_SEC(8, 0, 0); angle = 16384; - } // Between 8 p.m and 12 a.m - else { - timef = (timesec - 72000) / 28800.0f; + } else { + timef = (timesec - mTM_TIME_TO_SEC(20, 0, 0)) / (f32)mTM_TIME_TO_SEC(8, 0, 0); angle = 16384; } |
