43 lines
1022 B
C
43 lines
1022 B
C
#ifndef PIXELDEFENSE_SOUNDS_H
|
|
#define PIXELDEFENSE_SOUNDS_H
|
|
|
|
#include <breeze.h>
|
|
#include <flecs.h>
|
|
#include <raylib.h>
|
|
|
|
typedef enum SoundType {
|
|
SOUND_WOOD_PUNCH,
|
|
SOUND_COUNT
|
|
} SoundType;
|
|
|
|
typedef struct SoundState {
|
|
Sound sounds[SOUND_COUNT];
|
|
Sound playing;
|
|
// 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);
|
|
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
|
|
|
|
|
|
|
|
#endif //PIXELDEFENSE_SOUNDS_H
|