summaryrefslogtreecommitdiff
path: root/include/audio.h
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik@amftech.nl>2023-10-28 12:34:52 +0200
committerAldrik Ramaekers <aldrik@amftech.nl>2023-10-28 12:34:52 +0200
commit5de0682c37fc8e9713bb566a637f19a3795abc4a (patch)
tree3269724b9027205faaa5792262ced3b4f3f064f7 /include/audio.h
parent06d520eb39b2448ee08dce9010651a423115c798 (diff)
prep for synched audio
Diffstat (limited to 'include/audio.h')
-rw-r--r--include/audio.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/include/audio.h b/include/audio.h
index 850e74e..92d460c 100644
--- a/include/audio.h
+++ b/include/audio.h
@@ -4,8 +4,27 @@
#include <projectbase/project_base.h>
#define CHANNEL_THROWABLES 0
-#define CHANNEL_SHOOTING 0
+#define CHANNEL_SHOOTING 1
+typedef enum t_audio_event_type {
+ EVENT_SHOOT,
+ EVENT_RELOAD,
+ EVENT_BOUNCE_THROWABLE,
+} audio_event_type;
+
+typedef struct t_audio_event {
+ bool active;
+ audio_event_type type;
+ u32 playerid;
+ vec3f position;
+} audio_event;
+
+audio_event audio_events[20] = {0};
+int max_audio_events = 20;
+
+void add_audio_event_to_queue(audio_event_type event, u32 playerid, vec3f position);
+void play_sounds_in_queue();
+void clear_sounds_in_queue();
void play_sound(int channel, Mix_Chunk* wav);
void play_positioned_sound(int channel, Mix_Chunk* wav, vec3f pos, float max_audible_dist);