mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
engine: client: make sound api const
This commit is contained in:
@@ -162,8 +162,8 @@ typedef struct snd_globals_s
|
|||||||
// API from engine to client (client calls these)
|
// API from engine to client (client calls these)
|
||||||
typedef struct sound_api_s
|
typedef struct sound_api_s
|
||||||
{
|
{
|
||||||
qboolean (*CL_GetEntitySpatialization)( struct channel_s *ch );
|
qboolean (*CL_GetEntitySpatialization)( channel_t *ch );
|
||||||
struct sfx_s* (*S_GetSfxByHandle)( sound_t handle );
|
sfx_t* (*S_GetSfxByHandle)( sound_t handle );
|
||||||
} sound_api_t;
|
} sound_api_t;
|
||||||
|
|
||||||
// Callbacks from client to engine (engine calls these when custom sound is active)
|
// Callbacks from client to engine (engine calls these when custom sound is active)
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ typedef struct cldll_func_s
|
|||||||
void (*pfnMoveEvent)( float forwardmove, float sidemove );
|
void (*pfnMoveEvent)( float forwardmove, float sidemove );
|
||||||
void (*pfnLookEvent)( float relyaw, float relpitch );
|
void (*pfnLookEvent)( float relyaw, float relpitch );
|
||||||
// Sound API
|
// 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;
|
} cldll_func_t;
|
||||||
|
|
||||||
#endif//CDLL_EXP_H
|
#endif//CDLL_EXP_H
|
||||||
|
|||||||
@@ -1935,7 +1935,7 @@ static void S_VoiceRecordStop_f( void )
|
|||||||
Voice_RecordStop();
|
Voice_RecordStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
static const sound_api_t s_clientSoundAPI = {
|
static const sound_api_t gSoundAPI = {
|
||||||
CL_GetEntitySpatialization,
|
CL_GetEntitySpatialization,
|
||||||
S_GetSfxByHandle,
|
S_GetSfxByHandle,
|
||||||
};
|
};
|
||||||
@@ -1952,7 +1952,7 @@ static qboolean S_InitSoundAPI( void )
|
|||||||
|
|
||||||
if( clgame.dllFuncs.pfnGetSoundInterface )
|
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 );
|
Con_Reportf( "%s: ^2initailized extended SoundAPI ^7ver. %i\n", __func__, CL_SOUND_INTERFACE_VERSION );
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user