summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/audio.h5
-rw-r--r--include/protocol.h9
2 files changed, 12 insertions, 2 deletions
diff --git a/include/audio.h b/include/audio.h
index 92d460c..b4657d7 100644
--- a/include/audio.h
+++ b/include/audio.h
@@ -19,8 +19,9 @@ typedef struct t_audio_event {
vec3f position;
} audio_event;
-audio_event audio_events[20] = {0};
-int max_audio_events = 20;
+#define MAX_AUDIO_EVENTS 20
+audio_event audio_events[MAX_AUDIO_EVENTS] = {0};
+int max_audio_events = MAX_AUDIO_EVENTS;
void add_audio_event_to_queue(audio_event_type event, u32 playerid, vec3f position);
void play_sounds_in_queue();
diff --git a/include/protocol.h b/include/protocol.h
index 9750d62..329810c 100644
--- a/include/protocol.h
+++ b/include/protocol.h
@@ -17,6 +17,7 @@ typedef enum t_network_message_type
MESSAGE_USER_SHOOT,
MESSAGE_BULLET_LIST,
MESSAGE_DROP_LIST,
+ MESSAGE_SOUND_LIST,
} network_message_type;
typedef struct t_protocol_generic_client_message
@@ -49,6 +50,13 @@ typedef struct t_protocol_user_list
player players[MAX_PLAYERS];
} protocol_user_list;
+#include "audio.h"
+typedef struct t_protocol_sound_list
+{
+ network_message_type type;
+ audio_event audio_events[MAX_AUDIO_EVENTS];
+} protocol_sound_list;
+
#include "zombies.h"
typedef struct t_protocol_zombie_list
{
@@ -118,6 +126,7 @@ allocator outgoing_allocator;
network_message create_protocol_get_id_up(u32 id);
network_message create_protocol_get_id_down(u32 id);
+network_message create_protocol_sound_list();
network_message create_protocol_user_list();
network_message create_protocol_user_moved(protocol_move_type move, u32 id);
network_message create_protocol_user_look(u32 id, float gunx, float guny);