diff options
| author | Aldrik Ramaekers <aldrik@amftech.nl> | 2023-10-28 15:39:00 +0200 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik@amftech.nl> | 2023-10-28 15:39:00 +0200 |
| commit | 1ac22220f6077b3367456384b4bb563f1c5c2d29 (patch) | |
| tree | 4a85a2af22fb76e029698638581e738a95ff9957 /include | |
| parent | 2f3be64ddfcd5beac009b56cee34812e20849ef1 (diff) | |
sound effects, throwable speed
Diffstat (limited to 'include')
| -rw-r--r-- | include/asset_defs.h | 7 | ||||
| -rw-r--r-- | include/audio.h | 4 | ||||
| -rw-r--r-- | include/objects.h | 1 | ||||
| -rw-r--r-- | include/throwables.h | 1 |
4 files changed, 13 insertions, 0 deletions
diff --git a/include/asset_defs.h b/include/asset_defs.h index 27c31e4..63f46bd 100644 --- a/include/asset_defs.h +++ b/include/asset_defs.h @@ -22,6 +22,9 @@ image* img_spawner; image* img_obj_plants; image* img_obj_wall1; +// Throwables +image* img_grenade; + // Players image* img_player; @@ -39,6 +42,10 @@ Mix_Chunk* wav_throwable_bounce; Mix_Chunk* wav_shoot_mp5; Mix_Chunk* wav_reload_mp5; +Mix_Chunk* wav_impact_wood; +Mix_Chunk* wav_error; + + void load_assets(); #endif
\ No newline at end of file diff --git a/include/audio.h b/include/audio.h index b4657d7..47cd10e 100644 --- a/include/audio.h +++ b/include/audio.h @@ -5,11 +5,13 @@ #define CHANNEL_THROWABLES 0 #define CHANNEL_SHOOTING 1 +#define CHANNEL_IMPACT 2 typedef enum t_audio_event_type { EVENT_SHOOT, EVENT_RELOAD, EVENT_BOUNCE_THROWABLE, + EVENT_IMPACT, } audio_event_type; typedef struct t_audio_event { @@ -17,12 +19,14 @@ typedef struct t_audio_event { audio_event_type type; u32 playerid; vec3f position; + object_type obj; } audio_event; #define MAX_AUDIO_EVENTS 20 audio_event audio_events[MAX_AUDIO_EVENTS] = {0}; int max_audio_events = MAX_AUDIO_EVENTS; +void add_object_audio_event_to_queue(audio_event_type event, object_type obj, u32 playerid, vec3f position); void add_audio_event_to_queue(audio_event_type event, u32 playerid, vec3f position); void play_sounds_in_queue(); void clear_sounds_in_queue(); diff --git a/include/objects.h b/include/objects.h index e742f1e..29e6db0 100644 --- a/include/objects.h +++ b/include/objects.h @@ -19,6 +19,7 @@ typedef struct t_light_emitter { } light_emitter; typedef enum t_object_type { + OBJECT_NONE = 0, OBJECT_COBBLESTONEWALL1 = 1, OBJECT_PLANTBOX1 = 2, } object_type; diff --git a/include/throwables.h b/include/throwables.h index f4507b6..16811b2 100644 --- a/include/throwables.h +++ b/include/throwables.h @@ -10,6 +10,7 @@ typedef enum t_throwable_type { + THROWABLE_NONE = 0, THROWABLE_GRENADE, } throwable_type; |
