engine: client: make sound api const

This commit is contained in:
TheEVolk
2026-04-08 14:27:24 +03:00
parent da3960c4f0
commit 386ca1b9bb
3 changed files with 5 additions and 5 deletions

View File

@@ -162,8 +162,8 @@ typedef struct snd_globals_s
// API from engine to client (client calls these)
typedef struct sound_api_s
{
qboolean (*CL_GetEntitySpatialization)( struct channel_s *ch );
struct sfx_s* (*S_GetSfxByHandle)( sound_t handle );
qboolean (*CL_GetEntitySpatialization)( channel_t *ch );
sfx_t* (*S_GetSfxByHandle)( sound_t handle );
} sound_api_t;
// Callbacks from client to engine (engine calls these when custom sound is active)

View File

@@ -81,7 +81,7 @@ typedef struct cldll_func_s
void (*pfnMoveEvent)( float forwardmove, float sidemove );
void (*pfnLookEvent)( float relyaw, float relpitch );
// Sound API
int (*pfnGetSoundInterface)( int version, sound_api_t *api, sound_interface_t *callback );
int (*pfnGetSoundInterface)( int version, const sound_api_t *api, sound_interface_t *callback );
} cldll_func_t;
#endif//CDLL_EXP_H

View File

@@ -1935,7 +1935,7 @@ static void S_VoiceRecordStop_f( void )
Voice_RecordStop();
}
static const sound_api_t s_clientSoundAPI = {
static const sound_api_t gSoundAPI = {
CL_GetEntitySpatialization,
S_GetSfxByHandle,
};
@@ -1952,7 +1952,7 @@ static qboolean S_InitSoundAPI( void )
if( clgame.dllFuncs.pfnGetSoundInterface )
{
if( clgame.dllFuncs.pfnGetSoundInterface( CL_SOUND_INTERFACE_VERSION, &s_clientSoundAPI, &clgame.soundFuncs ))
if( clgame.dllFuncs.pfnGetSoundInterface( CL_SOUND_INTERFACE_VERSION, &gSoundAPI, &clgame.soundFuncs ))
{
Con_Reportf( "%s: ^2initailized extended SoundAPI ^7ver. %i\n", __func__, CL_SOUND_INTERFACE_VERSION );
return true;