2009-08-07 22:00:00 +02:00
|
|
|
|
//=======================================================================
|
|
|
|
|
// Copyright XashXT Group 2007 <20>
|
|
|
|
|
// s_export.c - sound library main
|
|
|
|
|
//=======================================================================
|
|
|
|
|
|
|
|
|
|
#include "sound.h"
|
|
|
|
|
|
|
|
|
|
vsound_imp_t si;
|
|
|
|
|
stdlib_api_t com;
|
|
|
|
|
byte *sndpool;
|
|
|
|
|
|
|
|
|
|
vsound_exp_t DLLEXPORT *CreateAPI( stdlib_api_t *input, vsound_imp_t *engfuncs )
|
|
|
|
|
{
|
|
|
|
|
static vsound_exp_t snd;
|
|
|
|
|
|
|
|
|
|
com = *input;
|
|
|
|
|
|
|
|
|
|
// Sys_LoadLibrary can create fake instance, to check
|
|
|
|
|
// api version and api size, but second argument will be 0
|
|
|
|
|
// and always make exception, run simply check for avoid it
|
2009-09-10 22:00:00 +02:00
|
|
|
|
if( engfuncs ) si = *engfuncs;
|
2009-08-07 22:00:00 +02:00
|
|
|
|
|
|
|
|
|
// generic functions
|
2009-09-10 22:00:00 +02:00
|
|
|
|
snd.api_size = sizeof( vsound_exp_t );
|
|
|
|
|
snd.com_size = sizeof( stdlib_api_t );
|
|
|
|
|
|
2009-08-07 22:00:00 +02:00
|
|
|
|
snd.Init = S_Init;
|
|
|
|
|
snd.Shutdown = S_Shutdown;
|
|
|
|
|
|
|
|
|
|
// sound manager
|
|
|
|
|
snd.BeginRegistration = S_BeginRegistration;
|
|
|
|
|
snd.RegisterSound = S_RegisterSound;
|
|
|
|
|
snd.EndRegistration = S_EndRegistration;
|
|
|
|
|
|
|
|
|
|
snd.StartSound = S_StartSound;
|
|
|
|
|
snd.StreamRawSamples = S_StreamRawSamples;
|
|
|
|
|
snd.AddLoopingSound = S_AddLoopingSound;
|
|
|
|
|
snd.StartLocalSound = S_StartLocalSound;
|
|
|
|
|
snd.StartBackgroundTrack = S_StartBackgroundTrack;
|
|
|
|
|
snd.StopBackgroundTrack = S_StopBackgroundTrack;
|
|
|
|
|
|
|
|
|
|
snd.StartStreaming = S_StartStreaming;
|
|
|
|
|
snd.StopStreaming = S_StopStreaming;
|
|
|
|
|
|
2009-10-06 22:00:00 +02:00
|
|
|
|
snd.RenderFrame = S_Update;
|
2009-08-07 22:00:00 +02:00
|
|
|
|
snd.StopAllSounds = S_StopAllSounds;
|
|
|
|
|
snd.FreeSounds = S_FreeSounds;
|
|
|
|
|
|
|
|
|
|
snd.Activate = S_Activate;
|
|
|
|
|
|
|
|
|
|
return &snd;
|
|
|
|
|
}
|