From ee7d998eab6c98ca6a0f595c48243877fa1bcdcc Mon Sep 17 00:00:00 2001 From: hgn Date: Mon, 25 Oct 2021 22:58:56 +0100 Subject: [PATCH] removed code cruft from audio --- vg/vg_audio.h | 38 ++++---------------------------------- 1 file changed, 4 insertions(+), 34 deletions(-) diff --git a/vg/vg_audio.h b/vg/vg_audio.h index 2191385..35b36c5 100644 --- a/vg/vg_audio.h +++ b/vg/vg_audio.h @@ -320,27 +320,12 @@ static void vg_audio_init(void) } } -#ifndef VYGER_RELEASE -u32 num_sfx_sets = 0; -#endif - // Shutdown audio device static void vg_audio_free(void) { ma_device_uninit( &g_aud_device ); } -// (debug) make sure we are shutting down safely -static void sfx_sys_chkerr(void) -{ -#ifndef VYGER_RELEASE - if( num_sfx_sets ) - { - vg_error( "Leaked %u sfx sets\n", num_sfx_sets ); - } -#endif -} - // 1 // ====================================================== @@ -348,9 +333,7 @@ static void sfx_sys_chkerr(void) static sfx_system *sfx_alloc(void) { if( sfx_sys_len >= SFX_MAX_SYSTEMS ) - { return NULL; - } // A conditional is done against this in localization step, // Needs to be initialized. @@ -564,7 +547,7 @@ void audio_mixer_callback( ma_device *pDevice, void *pOutBuf, const void *pInput // Load strings into sfx_set's memory // String layout: "sounda.ogg\0soundb.ogg\0soundc.ogg\0\0" -void sfx_set_strings( sfx_set *dest, char *strSources, u32 flags, int bAsync ) +static void sfx_set_strings( sfx_set *dest, char *strSources, u32 flags, int bAsync ) { printf( "Init sfx set\n| start | end | length | name \n" ); @@ -617,29 +600,19 @@ void sfx_set_strings( sfx_set *dest, char *strSources, u32 flags, int bAsync ) vg_info( "finished, numsegments: %u\n", dest->numsegments ); } -void sfx_set_init( sfx_set *dest, char *sources ) +static void sfx_set_init( sfx_set *dest, char *sources ) { -#ifndef VYGER_RELEASE - num_sfx_sets ++; -#endif - if( !sources ) - { sfx_set_strings( dest, dest->sources, dest->flags, 0 ); - } else - { sfx_set_strings( dest, sources, dest->flags, 0 ); - } } // Pick a random sound from the buffer and play it into system -void sfx_set_playrnd( sfx_set *source, sfx_system *sys, int min_id, int max_id ) +static void sfx_set_playrnd( sfx_set *source, sfx_system *sys, int min_id, int max_id ) { if( !source->numsegments ) - { return; - } int pick = (rand() % (max_id-min_id)) + min_id; @@ -661,10 +634,7 @@ static void sfx_system_fadeout( sfx_system *sys, u32 length_samples ) } // Free set resources -void sfx_set_free( sfx_set *set ) +static void sfx_set_free( sfx_set *set ) { -#ifndef VYGER_RELEASE - num_sfx_sets --; -#endif free( set->main ); } -- 2.25.1