![]() |
DarkPlaces
Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc
|
|
#include "matrixlib.h"
Go to the source code of this file.
Macros | |
#define | CHAN_ENGINE2CVAR(c) |
#define | CHAN_ENGINE2NET(c) |
#define | CHAN_ENGINE2USER(c) |
#define | CHAN_MAX_AUTO 0 |
#define | CHAN_MAX_SINGLE 127 |
#define | CHAN_MIN_AUTO -128 |
#define | CHAN_MIN_SINGLE 1 |
#define | CHAN_NET2ENGINE(c) |
#define | CHAN_USER2ENGINE(c) |
#define | CHANNELFLAG_FORCELOOP (1 << 1) |
#define | CHANNELFLAG_FULLVOLUME (1 << 4) |
#define | CHANNELFLAG_LOCALSOUND (1 << 2) |
#define | CHANNELFLAG_NONE 0 |
#define | CHANNELFLAG_PAUSED (1 << 3) |
#define | CHANNELFLAG_RELIABLE (1 << 0) |
#define | DEFAULT_SOUND_PACKET_ATTENUATION 1.0 |
#define | DEFAULT_SOUND_PACKET_VOLUME 255 |
#define | IS_CHAN(n) |
#define | IS_CHAN_AUTO(n) |
#define | IS_CHAN_SINGLE(n) |
Variables | |
cvar_t | bgmvolume |
cvar_t | snd_initialized |
cvar_t | volume |
#define CHAN_ENGINE2CVAR | ( | c | ) |
#define CHAN_ENGINE2NET | ( | c | ) |
#define CHAN_ENGINE2USER | ( | c | ) |
#define CHAN_USER2ENGINE | ( | c | ) |
Definition at line 90 of file sound.h.
Referenced by VM_getsoundtime(), and VM_SV_sound().
#define CHANNELFLAG_FORCELOOP (1 << 1) |
Definition at line 39 of file sound.h.
Referenced by CDAudio_Play_byName(), S_ClearUsed(), S_MixToBuffer(), S_PlaySfxOnChannel(), S_SetChannelFlag(), S_StaticSound(), SND_PickChannel(), VM_CL_sound(), and VM_SV_sound().
#define CHANNELFLAG_FULLVOLUME (1 << 4) |
Definition at line 42 of file sound.h.
Referenced by CDAudio_Play_byName(), S_SetChannelFlag(), SND_Spatialize_WithSfx(), VM_CL_sound(), and VM_SV_sound().
#define CHANNELFLAG_LOCALSOUND (1 << 2) |
Definition at line 40 of file sound.h.
Referenced by CDAudio_Play_byName(), S_LocalSoundEx(), S_PauseGameSounds(), S_Play_Common(), and S_SetChannelFlag().
#define CHANNELFLAG_NONE 0 |
Definition at line 37 of file sound.h.
Referenced by CL_ParseStartSoundPacket(), and S_StartSound().
#define CHANNELFLAG_PAUSED (1 << 3) |
Definition at line 41 of file sound.h.
Referenced by CDAudio_Pause(), CDAudio_Resume(), S_MixToBuffer(), S_PauseGameSounds(), S_SetChannelFlag(), VM_CL_sound(), and VM_SV_sound().
#define CHANNELFLAG_RELIABLE (1 << 0) |
Definition at line 38 of file sound.h.
Referenced by VM_CL_sound(), and VM_SV_sound().
#define DEFAULT_SOUND_PACKET_ATTENUATION 1.0 |
Definition at line 33 of file sound.h.
Referenced by CL_ParseStartSoundPacket(), SV_StartPointSound(), and SV_StartSound().
#define DEFAULT_SOUND_PACKET_VOLUME 255 |
Definition at line 32 of file sound.h.
Referenced by CL_ParseStartSoundPacket(), SV_StartPointSound(), and SV_StartSound().
#define IS_CHAN | ( | n | ) |
Definition at line 82 of file sound.h.
Referenced by SV_StartSound(), VM_CL_sound(), VM_getsoundtime(), and VM_SV_sound().
#define IS_CHAN_AUTO | ( | n | ) |
#define IS_CHAN_SINGLE | ( | n | ) |
Definition at line 81 of file sound.h.
Referenced by S_StartSound_StartPosition_Flags(), and SND_PickChannel().
Definition at line 996 of file snd_main.c.
References ambient_names, ambient_sfxs, channel_t::basespeed, channel_t::basevolume, CHANNELFLAG_FORCELOOP, channels, channel_t::flags, sfx_t::flags, i, known_sfx, channel_t::mixspeed, NULL, S_PrecacheSound(), channel_t::sfx, SFXFLAG_LEVELSOUND, and SFXFLAG_MENUSOUND.
Referenced by CL_ParseServerInfo(), and QW_CL_RequestNextDownload().
sfx_t * S_FindName | ( | const char * | name | ) |
Definition at line 895 of file snd_main.c.
References changevolume_sfx, cl, Con_Printf(), dp_strlcpy, cvar_t::integer, known_sfx, MAX_SOUNDS, Mem_Alloc, name, sfx_t::name, NULL, snd_initialized, snd_mempool, client_state_t::sound_precache, and strlen().
Referenced by S_PrecacheSound(), S_SoundLength(), VM_CL_ambientsound(), VM_CL_pointsound(), and VM_CL_sound().
Definition at line 1773 of file snd_main.c.
References channels, channel_t::position, and channel_t::sfx.
Referenced by CDAudio_GetPosition(), and S_GetEntChannelPosition().
Definition at line 1790 of file snd_main.c.
References channels, channel_t::entchannel, channel_t::entnum, entnum, i, S_GetChannelPosition(), and total_channels.
Referenced by VM_getsoundtime().
Definition at line 382 of file snd_main.c.
References snd_format_t::channels, snd_ringbuffer_t::format, and snd_renderbuffer.
Referenced by XMP_LoadModFile().
Definition at line 377 of file snd_main.c.
References snd_ringbuffer_t::format, snd_renderbuffer, and snd_format_t::speed.
Referenced by S_SoundLength(), and XMP_LoadModFile().
Definition at line 387 of file snd_main.c.
References snd_ringbuffer_t::format, snd_renderbuffer, and snd_format_t::width.
Referenced by XMP_LoadModFile().
Definition at line 706 of file snd_main.c.
References _snd_mixahead, ambient_fade, ambient_level, bgmvolume, CDAudio_Init(), CF_CLIENT, channels, Cmd_AddCommand(), Cmd_NoOperation_f(), Cvar_RegisterVariable(), Cvar_SetValueQuick(), known_sfx, mastervolume, MAX_CHANNELS, MAX_DYNAMIC_CHANNELS, Mem_AllocPool, nosound, NULL, NUM_AMBIENTS, OGG_OpenLibrary(), S_PauseSound_f(), S_Play2_f(), S_Play_f(), S_PlayVol_f(), S_Restart_f(), S_SoundInfo_f(), S_SoundList_f(), S_StopAllSounds_f(), S_UnloadAllSounds_f(), simsound, snd_attenuation_decibel, snd_attenuation_exponent, snd_bufferlength, snd_channel0volume, snd_channel1volume, snd_channel2volume, snd_channel3volume, snd_channel4volume, snd_channel5volume, snd_channel6volume, snd_channel7volume, snd_channellayout, snd_channels, snd_csqcchannel0volume, snd_csqcchannel1volume, snd_csqcchannel2volume, snd_csqcchannel3volume, snd_csqcchannel4volume, snd_csqcchannel5volume, snd_csqcchannel6volume, snd_csqcchannel7volume, snd_entchannel0volume, snd_entchannel1volume, snd_entchannel2volume, snd_entchannel3volume, snd_entchannel4volume, snd_entchannel5volume, snd_entchannel6volume, snd_entchannel7volume, snd_identicalsoundrandomization_tics, snd_identicalsoundrandomization_time, snd_initialized, snd_maxchannelvolume, snd_mempool, snd_mutewhenidle, snd_playerchannel0volume, snd_playerchannel1volume, snd_playerchannel2volume, snd_playerchannel3volume, snd_playerchannel4volume, snd_playerchannel5volume, snd_playerchannel6volume, snd_playerchannel7volume, snd_precache, snd_show, snd_softclip, snd_soundradius, snd_spatialization_control, snd_spatialization_max, snd_spatialization_max_radius, snd_spatialization_min, snd_spatialization_min_radius, snd_spatialization_occlusion, snd_spatialization_power, snd_spatialization_prologic, snd_spatialization_prologic_frontangle, snd_speed, snd_startloopingsounds, snd_startnonloopingsounds, snd_staticvolume, snd_streaming, snd_streaming_length, snd_swapstereo, snd_waterfx, snd_width, snd_worldchannel0volume, snd_worldchannel1volume, snd_worldchannel2volume, snd_worldchannel3volume, snd_worldchannel4volume, snd_worldchannel5volume, snd_worldchannel6volume, snd_worldchannel7volume, Sys_CheckParm(), total_channels, volume, and XMP_OpenLibrary().
Referenced by CL_Init().
qbool S_IsSoundPrecached | ( | const sfx_t * | sfx | ) |
Definition at line 1105 of file snd_main.c.
References changevolume_sfx, and NULL.
Referenced by CL_BeginDownloads().
qbool S_LocalSound | ( | const char * | s | ) |
Definition at line 2246 of file snd_main.c.
References S_LocalSoundEx().
Referenced by Con_MaskPrint(), M_Demo_Key(), M_Draw(), M_GameOptions_Key(), M_Keys_Key(), M_LanConfig_Key(), M_Load_Key(), M_Main_Key(), M_Menu_ModList_AdjustSliders(), M_Menu_Options_AdjustSliders(), M_Menu_Options_ColorControl_AdjustSliders(), M_Menu_Options_Effects_AdjustSliders(), M_Menu_Options_Graphics_AdjustSliders(), M_Menu_Video_AdjustSliders(), M_ModList_Key(), M_MultiPlayer_Key(), M_Options_ColorControl_Key(), M_Options_Effects_Key(), M_Options_Graphics_Key(), M_Options_Key(), M_Save_Key(), M_ServerList_Key(), M_Setup_Key(), M_SinglePlayer_Key(), M_Transfusion_Episode_Key(), M_Transfusion_Skill_Key(), M_Video_Key(), and VM_localsound().
Definition at line 2217 of file snd_main.c.
References CHANNELFLAG_LOCALSOUND, channels, cl, Con_Printf(), channel_t::flags, cvar_t::integer, nosound, S_PrecacheSound(), S_StartSound(), SFXFLAG_MENUSOUND, snd_initialized, vec3_origin, and client_state_t::viewentity.
Referenced by S_LocalSound(), and VM_localsound().
Definition at line 1749 of file snd_main.c.
References CHANNELFLAG_LOCALSOUND, CHANNELFLAG_PAUSED, channels, channel_t::flags, i, NULL, S_SetChannelFlag(), channel_t::sfx, and total_channels.
Referenced by CL_ParseServerMessage(), and S_PauseSound_f().
Definition at line 1048 of file snd_main.c.
References cvar_t::integer, name, nosound, NULL, S_FindName(), S_LoadSound(), SFXFLAG_LEVELSOUND, SFXFLAG_MENUSOUND, snd_initialized, and snd_precache.
Referenced by CDAudio_Play_byName(), CL_BeginDownloads(), CL_ParseServerInfo(), CL_ParseServerMessage(), dpvsimpledecode_open(), jam_open(), LibAvW_OpenVideo(), QW_CL_RequestNextDownload(), S_ClearUsed(), S_LocalSoundEx(), S_Play_Common(), and VM_precache_sound().
Definition at line 1028 of file snd_main.c.
References known_sfx, S_FreeSfx(), SFXFLAG_LEVELSOUND, and SFXFLAG_MENUSOUND.
Referenced by CL_SignonReply().
Definition at line 1679 of file snd_main.c.
References CHANNELFLAG_FORCELOOP, CHANNELFLAG_FULLVOLUME, CHANNELFLAG_LOCALSOUND, CHANNELFLAG_PAUSED, channels, channel_t::flags, total_channels, and value.
Referenced by CDAudio_Pause(), CDAudio_Resume(), S_PauseGameSounds(), and S_StartSound_StartPosition_Flags().
Definition at line 1768 of file snd_main.c.
References channel_t::basespeed, and channels.
Referenced by S_PlaySfxOnChannel(), and S_StartSound_StartPosition_Flags().
Definition at line 1763 of file snd_main.c.
References channel_t::basevolume, and channels.
Referenced by CDAudio_SetVolume(), S_PlaySfxOnChannel(), and S_StartSound_StartPosition_Flags().
Definition at line 668 of file snd_main.c.
References CDAudio_Shutdown(), snd_ringbuffer_t::endframe, Mem_Free, NULL, oldpaintedtime, snd_ringbuffer_t::ring, simsound, snd_renderbuffer, and SndSys_Shutdown().
Referenced by S_Restart_f(), and S_Terminate().
float S_SoundLength | ( | const char * | name | ) |
Definition at line 1085 of file snd_main.c.
References float, cvar_t::integer, name, NULL, S_FindName(), S_GetSoundRate(), and snd_initialized.
Referenced by VM_soundlength().
int S_StartSound | ( | int | entnum, |
int | entchannel, | ||
sfx_t * | sfx, | ||
vec3_t | origin, | ||
float | fvol, | ||
float | attenuation ) |
S_StartSound returns the channel index, or -1 if an error occurred.
Definition at line 1643 of file snd_main.c.
References CHANNELFLAG_NONE, entnum, origin, and S_StartSound_StartPosition_Flags().
Referenced by CL_ParseTempEntity(), dpvsimpledecode_open(), jam_open(), libavw_decodeframe(), S_LocalSoundEx(), S_Play_Common(), VM_CL_pointsound(), VM_CL_te_explosion(), VM_CL_te_explosion2(), VM_CL_te_explosionquad(), VM_CL_te_gunshot(), VM_CL_te_gunshotquad(), VM_CL_te_knightspike(), VM_CL_te_spike(), VM_CL_te_spikequad(), VM_CL_te_superspike(), VM_CL_te_superspikequad(), VM_CL_te_tarexplosion(), and VM_CL_te_wizspike().
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 ) |
Definition at line 1571 of file snd_main.c.
References channel_t::basespeed, ca_connected, changevolume_sfx, channels, cl, cls, channel_t::distfade, channel_t::entchannel, channel_t::entnum, entnum, fabs(), channel_t::flags, flags, i, int(), cvar_t::integer, IS_CHAN_SINGLE, lhrandom, MAX_DYNAMIC_CHANNELS, client_state_t::mtime, nosound, NULL, NUM_AMBIENTS, origin, channel_t::position, S_PlaySfxOnChannel(), S_SetChannelFlag(), S_SetChannelSpeed(), S_SetChannelVolume(), channel_t::sfx, snd_identicalsoundrandomization_tics, snd_identicalsoundrandomization_time, SND_PickChannel(), snd_renderbuffer, snd_soundradius, SND_Spatialize(), client_static_t::state, and cvar_t::value.
Referenced by CDAudio_Play_byName(), CL_ParseStartSoundPacket(), S_StartSound(), and VM_CL_sound().
Definition at line 476 of file snd_main.c.
References sys_t::argc, sys_t::argv, CDAudio_Startup(), snd_format_t::channels, Con_Print(), Con_Printf(), current_channellayout_used, Cvar_SetValueQuick(), snd_ringbuffer_t::endframe, extrasoundtime, snd_ringbuffer_t::format, host, i, cvar_t::integer, snd_ringbuffer_t::maxframes, NULL, oldpaintedtime, host_static_t::realtime, S_SetChannelLayout(), simsound, SND_CHANNELLAYOUT_AUTO, snd_channels, Snd_CreateRingBuffer(), snd_initialized, SND_MAX_CHANNELS, SND_MAX_SPEED, SND_MAX_WIDTH, SND_MIN_CHANNELS, SND_MIN_SPEED, SND_MIN_WIDTH, snd_renderbuffer, snd_speed, snd_starttime, snd_width, SndSys_Init(), soundtime, snd_format_t::speed, snd_ringbuffer_t::startframe, sys, Sys_CheckParm(), and snd_format_t::width.
Referenced by Host_Init(), and S_Restart_f().
Definition at line 1809 of file snd_main.c.
References CHANNELFLAG_FORCELOOP, channels, Con_Print(), Con_Printf(), cvar_t::integer, MAX_CHANNELS, nosound, NULL, origin, S_PlaySfxOnChannel(), snd_renderbuffer, and total_channels.
Referenced by CL_ParseStaticSound(), and VM_CL_ambientsound().
Definition at line 1710 of file snd_main.c.
References CDAudio_Stop(), channels, snd_format_t::channels, snd_ringbuffer_t::format, i, MAX_CHANNELS, MAX_DYNAMIC_CHANNELS, snd_ringbuffer_t::maxframes, NULL, NUM_AMBIENTS, snd_ringbuffer_t::ring, S_StopChannel(), simsound, snd_renderbuffer, SndSys_LockRenderBuffer(), SndSys_UnlockRenderBuffer(), total_channels, and snd_format_t::width.
Referenced by CL_ClearState(), CL_DisconnectEx(), CL_ParseServerInfo(), CL_Reconnect_f(), CL_Shutdown(), QW_CL_Changing_f(), S_StopAllSounds_f(), S_UnloadAllSounds_f(), SV_SpawnServer(), Sys_Error(), and Sys_HandleCrash().
void S_StopAllSounds_f | ( | struct cmd_state_s * | cmd | ) |
Definition at line 1648 of file snd_main.c.
References channels, channel_t::fetcher_data, NULL, S_FreeSfx(), channel_t::sfx, simsound, SndSys_LockRenderBuffer(), SndSys_UnlockRenderBuffer(), and total_channels.
Referenced by CDAudio_Stop(), dpvsimpledecode_close(), jam_close(), libavw_close(), S_FreeSfx(), S_MixToBuffer(), S_PlaySfxOnChannel(), S_StopAllSounds(), S_StopSound(), and SND_PickChannel().
Definition at line 1698 of file snd_main.c.
References channels, entnum, i, MAX_DYNAMIC_CHANNELS, and S_StopChannel().
Referenced by CL_ParseServerMessage().
Definition at line 842 of file snd_main.c.
References Cvar_SetValueQuick(), known_sfx, Mem_FreePool, NULL, OGG_CloseLibrary(), S_FreeSfx(), S_Shutdown(), snd_initialized, snd_mempool, and XMP_CloseLibrary().
Referenced by CL_Shutdown().
void S_UnloadAllSounds_f | ( | struct cmd_state_s * | cmd | ) |
void S_Update | ( | const matrix4x4_t * | listenermatrix | ) |
Definition at line 2061 of file snd_main.c.
References boolxor, channels, cl, cls, Con_Printf(), current_channellayout, current_swapstereo, i, cvar_t::integer, listener_basematrix, listener_matrix, listener_origin, listener_pvs, listener_pvsbytes, speakerlayout_t::listeners, log(), Matrix4x4_Concat(), Matrix4x4_CreateFromQuakeEntity(), Matrix4x4_Invert_Simple(), Matrix4x4_OriginFromMatrix(), max, MAX_DYNAMIC_CHANNELS, Mem_Free, cl_soundstats_t::mixedsounds, nosound, NULL, NUM_AMBIENTS, pow(), R_TimeReport(), S_PaintAndSubmit(), S_SetChannelLayout(), S_UpdateAmbientSounds(), channel_t::sfx, snd_blocked, snd_channellayout, SND_LISTENERS, snd_mempool, snd_mutewhenidle, snd_renderbuffer, snd_show, snd_spatialization_control, snd_spatialization_max, snd_spatialization_max_radius, snd_spatialization_min, snd_spatialization_min_radius, snd_spatialization_power, SND_Spatialize(), snd_speakerlayout, snd_swapstereo, client_static_t::soundstats, SPATIAL_LOG, SPATIAL_NONE, SPATIAL_POW, SPATIAL_THRESH, spatialdiff, spatialfactor, spatialmethod, spatialmin, spatialoffset, spatialpower, client_static_t::timedemo, total_channels, cl_soundstats_t::totalsounds, v_flipped, cvar_t::value, vid_activewindow, vid_hidden, channel_t::volume, client_state_t::worldmodel, and listener_t::yawangle.
Referenced by CL_Frame().
|
extern |
Definition at line 165 of file snd_main.c.
Referenced by CDAudio_Play_byName(), CDAudio_Update(), CL_ParseServerMessage(), M_Menu_Options_AdjustSliders(), M_Options_Draw(), and S_Init().
|
extern |
Definition at line 167 of file snd_main.c.
Referenced by CL_ParseServerMessage(), M_Options_Draw(), S_FindName(), S_Init(), S_LocalSoundEx(), S_PrecacheSound(), S_SoundLength(), S_Startup(), S_Terminate(), and VM_precache_sound().
|
extern |
Definition at line 166 of file snd_main.c.
Referenced by M_Menu_Options_AdjustSliders(), M_Options_Draw(), S_Init(), S_UpdateAmbientSounds(), and SND_Spatialize_WithSfx().