Add music, fix main menu scene

This commit is contained in:
2024-01-28 18:17:39 +01:00
parent 77d6173962
commit dfc20b6a96
7 changed files with 105 additions and 31 deletions

View File

@@ -16,6 +16,9 @@ typedef struct SoundState {
// How long it needs to wait,
// before playing the same sound
f32 soundInterval[SOUND_COUNT];
bool musicLoaded;
Music music;
} SoundState;
void soundsLoad(SoundState *sounds, SoundType type, f32 interval, const char *path);
@@ -23,6 +26,15 @@ void soundsPlay(SoundState *sounds, SoundType type);
void soundsUnloadAll(SoundState *sounds);
void soundsUpdate(SoundState *sounds);
void soundsLoadMusicStream(SoundState *sounds, const char *path);
void soundsPlayMusicStream(SoundState *sounds);
void soundsPauseMusicStream(SoundState *sounds);
void soundsResumeMusicStream(SoundState *sounds);
void soundsUnloadMusicStream(SoundState *sounds);
extern ECS_COMPONENT_DECLARE(SoundState); // defined in main.c