Exposed registering a handler for playing sounds.
This commit is contained in:
+1
-1
@@ -4,6 +4,7 @@
|
||||
#include "game/area.h"
|
||||
#include "game/level_update.h"
|
||||
#include "../libsm64.h"
|
||||
#include "../play_sound.h"
|
||||
#include "global_state.h"
|
||||
|
||||
#define COURSE_MIN 0
|
||||
@@ -36,7 +37,6 @@
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||
|
||||
static void play_sound(s32 soundBits, f32 *pos) {}
|
||||
static void enable_time_stop() {}
|
||||
static void disable_time_stop() {}
|
||||
static void *segmented_to_virtual(const void *addr) { return (void*)addr; }
|
||||
|
||||
@@ -85,6 +85,13 @@ SM64_LIB_FN void sm64_register_debug_print_function( SM64DebugPrintFunctionPtr d
|
||||
g_debug_print_func = debugPrintFunction;
|
||||
}
|
||||
|
||||
typedef void (*SM64PlaySoundFunctionPtr)( uint32_t soundBits, f32 *pos );
|
||||
SM64_LIB_FN void sm64_register_play_sound_function( SM64PlaySoundFunctionPtr playSoundFunction )
|
||||
{
|
||||
g_play_sound_func = playSoundFunction;
|
||||
}
|
||||
|
||||
|
||||
SM64_LIB_FN void sm64_global_init( uint8_t *rom, uint8_t *outTexture )
|
||||
{
|
||||
if( s_init_global )
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "decomp/include/types.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifdef SM64_LIB_EXPORT
|
||||
#define SM64_LIB_FN __declspec(dllexport)
|
||||
@@ -67,9 +69,14 @@ enum
|
||||
SM64_GEO_MAX_TRIANGLES = 1024,
|
||||
};
|
||||
|
||||
|
||||
typedef void (*SM64DebugPrintFunctionPtr)( const char * );
|
||||
extern SM64_LIB_FN void sm64_register_debug_print_function( SM64DebugPrintFunctionPtr debugPrintFunction );
|
||||
|
||||
typedef void (*SM64PlaySoundFunctionPtr)( uint32_t soundBits, f32 *pos );
|
||||
extern SM64_LIB_FN void sm64_register_play_sound_function( SM64PlaySoundFunctionPtr playSoundFunction );
|
||||
|
||||
|
||||
extern SM64_LIB_FN void sm64_global_init( uint8_t *rom, uint8_t *outTexture );
|
||||
extern SM64_LIB_FN void sm64_global_terminate( void );
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
#include "play_sound.h"
|
||||
|
||||
SM64PlaySoundFunctionPtr g_play_sound_func = NULL;
|
||||
|
||||
extern void play_sound( uint32_t soundBits, f32 *pos ) {
|
||||
if ( g_play_sound_func ) {
|
||||
g_play_sound_func(soundBits, pos);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "decomp/include/types.h"
|
||||
#include "libsm64.h"
|
||||
#include <stdio.h>
|
||||
|
||||
extern SM64PlaySoundFunctionPtr g_play_sound_func;
|
||||
|
||||
extern void play_sound( uint32_t soundBits, f32 *pos );
|
||||
Reference in New Issue
Block a user