diff options
| author | Anghelo Carvajal <angheloalf95@gmail.com> | 2023-06-18 02:43:47 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-18 16:43:47 +1000 |
| commit | 587d12e3cbb2a1ffb6774c0823c54ce0e80a579b (patch) | |
| tree | 77e25fd29e6bce3b979b7d50ec3851c9d2a9fc1e /src/code/z_sound_source.c | |
| parent | 9c40dea7709726bd29fac8253586bc96c9f3ab8a (diff) | |
Yet another header cleanup (#1284)
* thread, scene and interface
* non header stuff
* fix missing stuff
* z64sound_source.h
* collision_check.h
* Update include/z64sound_source.h
Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
* Update include/z64scene.h
Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
* Update include/z64thread.h
Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
* review
* review
* Update src/code/z_collision_check.c
Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
* Update src/code/z_sound_source.c
Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
---------
Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
Diffstat (limited to 'src/code/z_sound_source.c')
| -rw-r--r-- | src/code/z_sound_source.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/code/z_sound_source.c b/src/code/z_sound_source.c index 15ebd018a..4962f7072 100644 --- a/src/code/z_sound_source.c +++ b/src/code/z_sound_source.c @@ -1,11 +1,12 @@ #include "global.h" +#include "z64sound_source.h" void SoundSource_InitAll(PlayState* play) { SoundSource* sources = &play->soundSources[0]; s32 i; // clang-format off - for (i = 0; i < ARRAY_COUNT(play->soundSources); i++) { sources[i].countdown = 0; } + for (i = 0; i < SOUND_SOURCE_COUNT; i++) { sources[i].countdown = 0; } // clang-format on } @@ -13,7 +14,7 @@ void SoundSource_UpdateAll(PlayState* play) { SoundSource* source = &play->soundSources[0]; s32 i; - for (i = 0; i < ARRAY_COUNT(play->soundSources); i++) { + for (i = 0; i < SOUND_SOURCE_COUNT; i++) { if (source->countdown != 0) { if (DECR(source->countdown) == 0) { AudioSfx_StopByPos(&source->projectedPos); @@ -37,7 +38,7 @@ void SoundSource_Add(PlayState* play, Vec3f* worldPos, u32 duration, u16 sfxId, s32 i; source = &play->soundSources[0]; - for (i = 0; i < ARRAY_COUNT(play->soundSources); i++) { + for (i = 0; i < SOUND_SOURCE_COUNT; i++) { if (source->countdown == 0) { break; } @@ -52,7 +53,7 @@ void SoundSource_Add(PlayState* play, Vec3f* worldPos, u32 duration, u16 sfxId, } // If no sound source is available, replace the sound source with the smallest remaining countdown - if (i >= ARRAY_COUNT(play->soundSources)) { + if (i >= SOUND_SOURCE_COUNT) { source = backupSource; AudioSfx_StopByPos(&source->projectedPos); } |
