summaryrefslogtreecommitdiff
path: root/source/snd_main.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2008-06-29 12:32:32 +0000
committerAndrey Nazarov <skuller@skuller.net>2008-06-29 12:32:32 +0000
commite826e5f176f21cd18b3bbc22887a266835ada57c (patch)
treed25a84a84f9168b16a77fe4ed8b169c9611bbb02 /source/snd_main.c
parent491f1c100e860c45a5d2aa358d58f777cd1cf895 (diff)
Added client and server side support for 32-bit solids.
New R1Q2 and Q2PRO minor protocol versions, 1905 and 1014. Use environment variables for game and server features negotiation. Relax restrictions on quake paths when searching inside pak files. Made OSS subsystem cvar names consistent with core sound system conventions. Misc latched cvar handling changes.
Diffstat (limited to 'source/snd_main.c')
-rw-r--r--source/snd_main.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/source/snd_main.c b/source/snd_main.c
index 4df6e01..4625722 100644
--- a/source/snd_main.c
+++ b/source/snd_main.c
@@ -36,7 +36,6 @@ int s_registration_sequence;
channel_t channels[MAX_CHANNELS];
qboolean sound_started;
-qboolean sound_modified;
dma_t dma;
@@ -156,10 +155,6 @@ static void S_SoundList_f( void ) {
Com_Printf( "Total resident: %i\n", total );
}
-static void s_param_changed( cvar_t *self ) {
- sound_modified = qtrue;
-}
-
static const cmdreg_t c_sound[] = {
{ "play", S_Play_f, S_Play_c },
{ "stopsound", S_StopAllSounds },
@@ -177,8 +172,7 @@ S_Init
void S_Init( void ) {
sndinitstat_t ret = SIS_FAILURE;
- s_enable = Cvar_Get( "s_enable", "1", 0 );
- s_enable->changed = s_param_changed;
+ s_enable = Cvar_Get( "s_enable", "1", CVAR_SOUND );
if( !s_enable->integer ) {
Com_Printf( "Sound initialization disabled.\n" );
return;
@@ -186,10 +180,10 @@ void S_Init( void ) {
Com_Printf( "------- S_Init -------\n" );
- s_khz = Cvar_Get( "s_khz", "22", CVAR_ARCHIVE );
+ s_khz = Cvar_Get( "s_khz", "22", CVAR_ARCHIVE|CVAR_SOUND );
#if USE_DSOUND
- s_direct = Cvar_Get( "s_direct", "1", 0 );
+ s_direct = Cvar_Get( "s_direct", "1", CVAR_ARCHIVE|CVAR_SOUND );
if( s_direct->integer ) {
DS_FillAPI( &snddma );
ret = snddma.Init();
@@ -224,11 +218,6 @@ void S_Init( void ) {
s_registration_sequence = 1;
-#if USE_DSOUND
- s_direct->changed = s_param_changed;
-#endif
- s_khz->changed = s_param_changed;
-
Com_Printf( "sound sampling rate: %i\n", dma.speed );
S_StopAllSounds();
@@ -1024,15 +1013,13 @@ S_Update
Called once each time through the main loop
============
*/
-void S_Update( void )
-{
+void S_Update( void ) {
int i;
int total;
channel_t *ch;
- if( sound_modified ) {
+ if( cvar_modified & CVAR_SOUND ) {
Cbuf_AddText( "snd_restart\n" );
- sound_modified = qfalse;
return;
}