diff --git a/src/client/cl_cin.c b/src/client/cl_cin.c index 573f989f..f9d1d44c 100644 --- a/src/client/cl_cin.c +++ b/src/client/cl_cin.c @@ -453,7 +453,9 @@ SCR_PlayCinematic(char *arg) { /* make sure CD isn't playing music */ CDAudio_Stop(); +#ifdef OGG OGG_Stop(); +#endif cl.cinematicframe = 0; dot = strstr(arg, "."); diff --git a/src/client/cl_main.c b/src/client/cl_main.c index 2ee8d8d5..00da222e 100644 --- a/src/client/cl_main.c +++ b/src/client/cl_main.c @@ -825,7 +825,9 @@ void CL_Shutdown(void) CL_WriteConfiguration (); CDAudio_Shutdown (); +#ifdef OGG OGG_Stop(); +#endif S_Shutdown(); VID_Shutdown(); } diff --git a/src/client/cl_network.c b/src/client/cl_network.c index b873960a..73a562db 100644 --- a/src/client/cl_network.c +++ b/src/client/cl_network.c @@ -291,7 +291,9 @@ void CL_Disconnect (void) cls.connect_time = 0; SCR_StopCinematic (); +#ifdef OGG OGG_Stop(); +#endif CDAudio_Stop(); if (cls.demorecording) diff --git a/src/client/cl_parse.c b/src/client/cl_parse.c index 627d8ffe..d725c2e2 100644 --- a/src/client/cl_parse.c +++ b/src/client/cl_parse.c @@ -839,6 +839,7 @@ void CL_ParseConfigString (void) { if (cl.refresh_prepped) { CDAudio_Play (atoi(cl.configstrings[CS_CDTRACK]), true); +#ifdef OGG /* OGG/Vorbis */ if (atoi(cl.configstrings[CS_CDTRACK]) < 10) { char tmp[3] = "0"; @@ -847,6 +848,7 @@ void CL_ParseConfigString (void) { } else { OGG_ParseCmd(cl.configstrings[CS_CDTRACK]); } +#endif } } else if (i >= CS_MODELS && i < CS_MODELS+MAX_MODELS) { diff --git a/src/client/cl_screen.c b/src/client/cl_screen.c index bfd1b629..7a44547a 100644 --- a/src/client/cl_screen.c +++ b/src/client/cl_screen.c @@ -444,7 +444,9 @@ void SCR_BeginLoadingPlaque (void) { S_StopAllSounds (); cl.sound_prepped = false; /* don't play ambients */ CDAudio_Stop (); +#ifdef OGG OGG_Stop(); +#endif if (cls.disable_screen) return; diff --git a/src/client/cl_view.c b/src/client/cl_view.c index d25b9678..76cd8072 100644 --- a/src/client/cl_view.c +++ b/src/client/cl_view.c @@ -309,6 +309,7 @@ void CL_PrepRefresh (void) { } else { CDAudio_Play (atoi(cl.configstrings[CS_CDTRACK]), true); +#ifdef OGG /* OGG/Vorbis */ if (atoi(cl.configstrings[CS_CDTRACK]) < 10) { char tmp[3] = "0"; @@ -317,6 +318,7 @@ void CL_PrepRefresh (void) { } else { OGG_ParseCmd(cl.configstrings[CS_CDTRACK]); } +#endif } } diff --git a/src/client/menu/menu.c b/src/client/menu/menu.c index 496cfc9e..667b71d5 100644 --- a/src/client/menu/menu.c +++ b/src/client/menu/menu.c @@ -1000,7 +1000,9 @@ static menulist_s s_options_crosshair_box; static menuslider_s s_options_sfxvolume_slider; static menulist_s s_options_cdvolume_box; static menulist_s s_options_cdshuffle_box; +#ifdef OGG static menulist_s s_options_oggvolume_box; +#endif static menulist_s s_options_quality_list; static menulist_s s_options_console_action; @@ -1036,6 +1038,7 @@ static void ControlsSetMenuItemValues( void ) { s_options_sfxvolume_slider.curvalue = Cvar_VariableValue( "s_volume" ) * 10; s_options_cdvolume_box.curvalue = !Cvar_VariableValue("cd_nocd"); +#ifdef OGG s_options_oggvolume_box.curvalue = Cvar_VariableValue("ogg_enable"); cvar_t *ogg; @@ -1043,9 +1046,9 @@ static void ControlsSetMenuItemValues( void ) { if(!strcmp(ogg->string, "random")) s_options_cdshuffle_box.curvalue = 1; - else s_options_cdshuffle_box.curvalue = 0; +#endif s_options_quality_list.curvalue = !Cvar_VariableValue( "s_loadas8bit" ); s_options_sensitivity_slider.curvalue = ( sensitivity->value ) * 2; @@ -1095,6 +1098,7 @@ static void UpdateVolumeFunc( void *unused ) { static void CDShuffleFunc(void *unused) { Cvar_SetValue("cd_shuffle", s_options_cdshuffle_box.curvalue); +#ifdef OGG cvar_t *ogg; ogg = Cvar_Get("ogg_enable", "1", CVAR_ARCHIVE); @@ -1119,14 +1123,19 @@ static void CDShuffleFunc(void *unused) { } } } +#endif } static void UpdateCDVolumeFunc( void *unused ) { Cvar_SetValue( "cd_nocd", (float)!s_options_cdvolume_box.curvalue ); +#ifdef OGG Cvar_SetValue( "ogg_enable", 0 ); +#endif if (s_options_cdvolume_box.curvalue) { +#ifdef OGG OGG_Shutdown(); +#endif CDAudio_Init(); if (s_options_cdshuffle_box.curvalue) { @@ -1141,6 +1150,7 @@ static void UpdateCDVolumeFunc( void *unused ) { } } +#ifdef OGG static void UpdateOGGVolumeFunc( void *unused ) { Cvar_SetValue( "ogg_enable", (float)s_options_oggvolume_box.curvalue ); Cvar_SetValue( "cd_nocd", 1 ); @@ -1162,6 +1172,7 @@ static void UpdateOGGVolumeFunc( void *unused ) { OGG_Shutdown(); } } +#endif extern void Key_ClearTyping( void ); static void ConsoleFunc( void *unused ) { @@ -1206,11 +1217,13 @@ static void Options_MenuInit( void ) { 0 }; +#ifdef OGG static const char *ogg_music_items[] = { "disabled", "enabled", 0 }; +#endif static const char *cd_shuffle[] = { "disabled", @@ -1258,6 +1271,7 @@ static void Options_MenuInit( void ) { s_options_cdvolume_box.itemnames = cd_music_items; s_options_cdvolume_box.curvalue = !Cvar_VariableValue("cd_nocd"); +#ifdef OGG s_options_oggvolume_box.generic.type = MTYPE_SPINCONTROL; s_options_oggvolume_box.generic.x = 0; s_options_oggvolume_box.generic.y = 20; @@ -1265,6 +1279,7 @@ static void Options_MenuInit( void ) { s_options_oggvolume_box.generic.callback = UpdateOGGVolumeFunc; s_options_oggvolume_box.itemnames = ogg_music_items; s_options_oggvolume_box.curvalue = Cvar_VariableValue("ogg_enable"); +#endif s_options_cdshuffle_box.generic.type = MTYPE_SPINCONTROL; s_options_cdshuffle_box.generic.x = 0; @@ -1354,7 +1369,9 @@ static void Options_MenuInit( void ) { Menu_AddItem( &s_options_menu, ( void * ) &s_options_sfxvolume_slider ); Menu_AddItem( &s_options_menu, ( void * ) &s_options_cdvolume_box ); +#ifdef OGG Menu_AddItem( &s_options_menu, ( void * ) &s_options_oggvolume_box ); +#endif Menu_AddItem( &s_options_menu, ( void * ) &s_options_cdshuffle_box ); Menu_AddItem( &s_options_menu, ( void * ) &s_options_quality_list ); Menu_AddItem( &s_options_menu, ( void * ) &s_options_sensitivity_slider ); diff --git a/src/client/sound/header/vorbis.h b/src/client/sound/header/vorbis.h index e351d333..726bc805 100644 --- a/src/client/sound/header/vorbis.h +++ b/src/client/sound/header/vorbis.h @@ -22,6 +22,8 @@ * ======================================================================= */ +#ifdef OGG + #ifndef CL_SOUND_VORBIS_H #define CL_SOUND_VORBIS_H @@ -68,4 +70,5 @@ void OGG_SeekCmd(void); void OGG_StatusCmd(void); #endif +#endif diff --git a/src/client/sound/snd_dma.c b/src/client/sound/snd_dma.c index 20273b42..2168fb6a 100644 --- a/src/client/sound/snd_dma.c +++ b/src/client/sound/snd_dma.c @@ -131,8 +131,10 @@ S_Init ( void ) Cmd_AddCommand( "stopsound", S_StopAllSounds ); Cmd_AddCommand( "soundlist", S_SoundList ); Cmd_AddCommand( "soundinfo", S_SoundInfo_f ); +#ifdef OGG Cmd_AddCommand( "ogg_init", OGG_Init ); Cmd_AddCommand( "ogg_shutdown", OGG_Shutdown ); +#endif if ( !SNDDMA_Init() ) { @@ -150,7 +152,9 @@ S_Init ( void ) Com_Printf( "sound sampling rate: %i\n", dma.speed ); S_StopAllSounds(); +#ifdef OGG OGG_Init(); +#endif } Com_Printf( "------------------------------------\n\n" ); @@ -189,7 +193,9 @@ S_Shutdown ( void ) num_sfx = 0; sound_started = 0; +#ifdef OGG OGG_Shutdown(); +#endif SNDDMA_Shutdown(); Cmd_RemoveCommand( "soundlist" ); @@ -1229,8 +1235,10 @@ S_Update ( vec3_t origin, vec3_t forward, vec3_t right, vec3_t up ) Com_Printf( "----(%i)---- painted: %i\n", total, paintedtime ); } +#ifdef OGG /* stream music */ OGG_Stream(); +#endif /* mix some sound */ if ( !sound_started ) diff --git a/src/client/sound/snd_vorbis.c b/src/client/sound/snd_vorbis.c index 3ce12525..4fb588c0 100644 --- a/src/client/sound/snd_vorbis.c +++ b/src/client/sound/snd_vorbis.c @@ -27,6 +27,8 @@ * ======================================================================= */ +#ifdef OGG + #include #include @@ -787,3 +789,5 @@ OGG_StatusCmd ( void ) } } +# endif /* OGG */ +