From 4ef8cf8b3d9ad5235aa858a68f70a8aaf2b356da Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Mon, 3 Jul 2023 21:40:42 +0100 Subject: Sound queue This is to queue sounds and play them when we update the screen, so the sounds are synced with the action. It is required because the MikMod_Update function updates on the clock int, and is not synced with the VGA's vsync. --- src/pickup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/pickup.c') diff --git a/src/pickup.c b/src/pickup.c index 7036891..91e44b2 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -136,7 +136,7 @@ void pickup_wait_update(Entity *e) if (e->counter-- == 0) { e->update = pickup_in_update; - sound_play_efx(EFX_WARP); + sound_queue_efx(EFX_WARP); } } @@ -174,7 +174,7 @@ void pickup_update(Entity *e) if (e->counter++ == MAX_TTL) { effect_out_init(e); - sound_play_efx(EFX_WARP); + sound_queue_efx(EFX_WARP); return; } @@ -208,6 +208,6 @@ void pickup_update(Entity *e) break; } e->used = 0; - sound_play_efx(EFX_PICKUP); + sound_queue_efx(EFX_PICKUP); } } -- cgit v1.2.3