}
}
-#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
// ======================================================
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.
// 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" );
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;
}
// 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 );
}