From 5de0682c37fc8e9713bb566a637f19a3795abc4a Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sat, 28 Oct 2023 12:34:52 +0200 Subject: prep for synched audio --- src/bullets.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/bullets.c') diff --git a/src/bullets.c b/src/bullets.c index d1c8d97..f5d5198 100644 --- a/src/bullets.c +++ b/src/bullets.c @@ -21,14 +21,14 @@ void shoot(platform_window* window, u32 id, float dirx, float diry) { if (bullets_to_shoot > p->ammo_in_mag) bullets_to_shoot = p->ammo_in_mag; p->ammo_in_mag -= bullets_to_shoot; if (p->ammo_in_mag == 0) { - play_positioned_sound(CHANNEL_SHOOTING, wav_reload_mp5, (vec3f){.x = p->playerx, .y = p->playery, .z = p->height}, 10); + add_audio_event_to_queue(EVENT_RELOAD, p->id, (vec3f){.x = p->playerx, .y = p->playery, .z = p->height}); p->interact_state = INTERACT_RELOADING; p->sec_since_interact_state_change = 0; return; } - play_positioned_sound(CHANNEL_SHOOTING, wav_shoot_mp5, (vec3f){.x = p->playerx, .y = p->playery, .z = p->height}, 20); - + add_audio_event_to_queue(EVENT_SHOOT, p->id, (vec3f){.x = p->playerx, .y = p->playery, .z = p->height}); + for (int i = 0; i < bullets_to_shoot; i++) { map_info info = get_map_info(window); -- cgit v1.2.3-70-g09d2