X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=sound.h;h=cacb23ae5e878818c03319727cbe6995e765cad9;hb=e8054fa0316150c3fdb748a66228ab7f9fcdeccb;hp=cb35c112707c2926deb9a1967af67a048955b747;hpb=37c4042c3dbb546c53bc5de8d556d2469b49289e;p=xonotic%2Fdarkplaces.git diff --git a/sound.h b/sound.h index cb35c112..cacb23ae 100644 --- a/sound.h +++ b/sound.h @@ -73,10 +73,31 @@ void S_ClearUsed (void); void S_PurgeUnused (void); qboolean S_IsSoundPrecached (const sfx_t *sfx); +// for sound() builtins +#define CHANFLAG_RELIABLE 1 + +// these define the "engine" channel namespace +#define CHAN_MIN_AUTO -128 +#define CHAN_MAX_AUTO 0 +#define CHAN_MIN_SINGLE 1 +#define CHAN_MAX_SINGLE 127 +#define IS_CHAN_AUTO(n) ((n) >= CHAN_MIN_AUTO && (n) <= CHAN_MAX_AUTO) +#define IS_CHAN_SINGLE(n) ((n) >= CHAN_MIN_SINGLE && (n) <= CHAN_MAX_SINGLE) +#define IS_CHAN(n) (IS_CHAN_AUTO(n) || IS_CHAN_SINGLE(n)) + +// engine channel == network channel +#define CHAN_ENGINE2NET(c) (c) +#define CHAN_NET2ENGINE(c) (c) + +// engine view of channel encodes the auto flag into the channel number (see CHAN_ constants below) +// user view uses the flags bitmask for it +#define CHAN_USER2ENGINE(c) (c) +#define CHAN_ENGINE2USER(c) (c) +#define CHAN_ENGINE2CVAR(c) (abs(c)) + // S_StartSound returns the channel index, or -1 if an error occurred int S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation); -int S_StartSound_StartPosition (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation, float startposition); -int S_StartSound_StartPosition_Flags (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation, float startposition, int flags); +int S_StartSound_StartPosition_Flags (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation, float startposition, int flags, float fspeed); qboolean S_LocalSound (const char *s); void S_StaticSound (sfx_t *sfx, vec3_t origin, float fvol, float attenuation); @@ -87,6 +108,7 @@ void S_PauseGameSounds (qboolean toggle); void S_StopChannel (unsigned int channel_ind, qboolean lockmutex, qboolean freesfx); qboolean S_SetChannelFlag (unsigned int ch_ind, unsigned int flag, qboolean value); void S_SetChannelVolume (unsigned int ch_ind, float fvol); +void S_SetChannelSpeed (unsigned int ch_ind, float fspeed); float S_GetChannelPosition (unsigned int ch_ind); float S_GetEntChannelPosition(int entnum, int entchannel);