Verified that audio has been initialized before playing sounds or ticking audio.
This commit is contained in:
+7
-4
@@ -2,14 +2,17 @@
|
||||
|
||||
#include "decomp/audio/external.h"
|
||||
#include "debug_print.h"
|
||||
#include "load_audio_data.h"
|
||||
|
||||
SM64PlaySoundFunctionPtr g_play_sound_func = NULL;
|
||||
|
||||
extern void play_sound( uint32_t soundBits, f32 *pos ) {
|
||||
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;
|
||||
sSoundRequestCount++;
|
||||
if ( 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;
|
||||
sSoundRequestCount++;
|
||||
}
|
||||
|
||||
if ( g_play_sound_func ) {
|
||||
g_play_sound_func(soundBits, pos);
|
||||
|
||||
Reference in New Issue
Block a user