From 766c80a4685a46666e89f0dfc887b162cc5ca1e4 Mon Sep 17 00:00:00 2001 From: Renato Rotenberg Date: Mon, 6 Feb 2023 21:28:21 -0300 Subject: [PATCH] Add `g_` prefix to `is_audio_initialized` --- src/libsm64.c | 4 ++-- src/load_audio_data.c | 8 ++++---- src/load_audio_data.h | 2 +- src/play_sound.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/libsm64.c b/src/libsm64.c index b684444..8f92a98 100644 --- a/src/libsm64.c +++ b/src/libsm64.c @@ -146,7 +146,7 @@ SM64_LIB_FN void sm64_audio_init( uint8_t *rom ) { #define SAMPLES_LOW 528 extern SM64_LIB_FN uint32_t sm64_audio_tick( uint32_t numQueuedSamples, uint32_t numDesiredSamples, int16_t *audio_buffer ) { - if ( !is_audio_initialized ) { + if ( !g_is_audio_initialized ) { DEBUG_PRINT("Attempted to tick audio, but sm64_audio_init() has not been called yet."); return 0; } @@ -271,7 +271,7 @@ SM64_LIB_FN void sm64_mario_delete( int32_t marioId ) struct GlobalState *globalState = ((struct MarioInstance *)s_mario_instance_pool.objects[ marioId ])->globalState; global_state_bind( globalState ); - if ( is_audio_initialized ) { + if ( g_is_audio_initialized ) { stop_sound(SOUND_MARIO_SNORING3, gMarioState->marioObj->header.gfx.cameraToObject); } diff --git a/src/load_audio_data.c b/src/load_audio_data.c index 5fe394f..bccf72c 100644 --- a/src/load_audio_data.c +++ b/src/load_audio_data.c @@ -4,7 +4,7 @@ #include "decomp/audio/load.h" #include "decomp/audio/load_dat.h" -bool is_audio_initialized = false; +bool g_is_audio_initialized = false; extern void load_audio_banks( uint8_t *rom ) { uint8_t *rom2 = malloc( 0x800000 ); @@ -19,9 +19,9 @@ extern void load_audio_banks( uint8_t *rom ) { gBankSetsData[0x45]=0x00; ptrs_to_offsets( gSoundDataADSR ); - audio_init(); + audio_init(); sound_init(); sound_reset( 0 ); - - is_audio_initialized = true; + + g_is_audio_initialized = true; } \ No newline at end of file diff --git a/src/load_audio_data.h b/src/load_audio_data.h index 8e2140c..93f8175 100644 --- a/src/load_audio_data.h +++ b/src/load_audio_data.h @@ -3,6 +3,6 @@ #include #include -extern bool is_audio_initialized; +extern bool g_is_audio_initialized; extern void load_audio_banks( uint8_t *rom ); \ No newline at end of file diff --git a/src/play_sound.c b/src/play_sound.c index 59ccf5b..27af905 100644 --- a/src/play_sound.c +++ b/src/play_sound.c @@ -7,7 +7,7 @@ SM64PlaySoundFunctionPtr g_play_sound_func = NULL; extern void play_sound( uint32_t soundBits, f32 *pos ) { - if ( is_audio_initialized ) { + if ( g_is_audio_initialized ) { DEBUG_PRINT("$ play_sound(%d) request %d; pos %f %f %f\n", soundBits,sSoundRequestCount,pos[0],pos[1],pos[2]); sSoundRequests[sSoundRequestCount].soundBits = soundBits; sSoundRequests[sSoundRequestCount].position = pos;