removed code cruft from audio
authorhgn <hgodden00@gmail.com>
Mon, 25 Oct 2021 21:58:56 +0000 (22:58 +0100)
committerhgn <hgodden00@gmail.com>
Mon, 25 Oct 2021 21:58:56 +0000 (22:58 +0100)
vg/vg_audio.h

index 2191385f438bbf77d017c6d3de115ae59c2da588..35b36c5f07a13aac6395a83200b4008bc1f3e6a0 100644 (file)
@@ -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 );
 }