@ -64,10 +64,12 @@ SND_Channel_t SND_MusicChannel;
FMOD_SYSTEM * fmod_system ;
FMOD_SOUND * fmod_sound ;
FMOD_CHANNELGROUP * musicChannelGroup ;
FMOD_CHANNELGROUP * sfxChannelGroup ;
FMOD_RESULT fmod_result ;
qboolean SND_Initialised ;
qboolean SND_InitialisedCD ;
int oldtrack ;
float oldbgmvolume ;
@ -207,21 +209,6 @@ void FMOD_Startup (void)
{
fmod_result = FMOD_System_SetOutput ( fmod_system , FMOD_OUTPUTTYPE_AUTODETECT ) ;
FMOD_ERROR ( fmod_result , true , false ) ;
/ / set the user selected speaker mode
/ / fmod_result = FMOD_System_SetSpeakerMode ( fmod_system , FMOD_SPEAKERMODE_STEREO /*speakermode*/ ) ;
/ / FMOD_ERROR ( fmod_result , true , false ) ;
/ / fmod_result = FMOD_System_GetDriverInfo ( fmod_system , 0 , name , 256 , NULL , NULL , NULL , NULL ) ;
/ / FMOD_ERROR ( fmod_result , true , false ) ;
/ /
/ / if ( strstr ( name , " SigmaTel " ) )
/ / {
/ / / / Sigmatel sound devices crackle for some reason if the format is PCM 16 bit .
/ / / / PCM floating point output seems to solve it .
/ / fmod_result = FMOD_System_SetSoftwareFormat ( fmod_system , 48000 , FMOD_SOUND_FORMAT_PCMFLOAT , 0 ) ;
/ / FMOD_ERROR ( fmod_result , true , false ) ;
/ / }
}
fmod_result = FMOD_System_GetSoftwareChannels ( fmod_system , & SND_SoftwareChannels ) ;
@ -233,23 +220,14 @@ void FMOD_Startup (void)
fmod_result = FMOD_System_Init ( fmod_system , MAX_CHANNELS , FMOD_INIT_NORMAL , NULL ) ;
FMOD_ERROR ( fmod_result , true , false ) ;
/ / if ( fmod_result = = FMOD_ERR_OUTPUT_CREATEBUFFER )
/ / {
/ / / / the speaker mode selected isn ' t supported by this soundcard . Switch it back to stereo . . .
/ / fmod_result = FMOD_System_SetSpeakerMode ( fmod_system , FMOD_SPEAKERMODE_STEREO ) ;
/ / FMOD_ERROR ( fmod_result , true , false ) ;
/ / / / . . . and re - init .
/ / fmod_result = FMOD_System_Init ( fmod_system , MAX_CHANNELS , FMOD_INIT_NORMAL , NULL ) ;
/ / FMOD_ERROR ( fmod_result , true , false ) ;
/ / }
/ / fmod_result = FMOD_System_GetSpeakerMode ( fmod_system , & speakermode ) ;
/ / FMOD_ERROR ( fmod_result , true , false ) ;
fmod_result = FMOD_System_GetOutput ( fmod_system , & fmod_output ) ;
FMOD_ERROR ( fmod_result , true , false ) ;
fmod_result = FMOD_System_CreateChannelGroup ( fmod_system , " Music " , & musicChannelGroup ) ;
FMOD_ERROR ( fmod_result , true , false ) ;
fmod_result = FMOD_System_CreateChannelGroup ( fmod_system , " SFX " , & sfxChannelGroup ) ;
FMOD_ERROR ( fmod_result , true , false ) ;
/ / print all the sound information to the console
Con_Printf ( " \n FMOD version %01x.%02x.%02x \n " , ( FMOD_VERSION > > 16 ) & 0xff , ( FMOD_VERSION > > 8 ) & 0xff , FMOD_VERSION & 0xff ) ;
@ -333,7 +311,6 @@ void FMOD_Shutdown(void)
if ( COM_CheckParm ( " -nosound " ) )
{
SND_Initialised = false ;
SND_InitialisedCD = false ;
return ;
}
@ -371,7 +348,6 @@ FMOD_Init
void FMOD_Init ( void )
{
SND_Initialised = false ;
SND_InitialisedCD = false ;
if ( ! sound_started )
return ;
@ -408,7 +384,6 @@ void FMOD_Restart (void)
if ( COM_CheckParm ( " -nosound " ) )
{
SND_Initialised = false ;
SND_InitialisedCD = false ;
return ;
}
@ -449,11 +424,7 @@ FMOD_ChannelStart
*/
void FMOD_ChannelStart ( FMOD_SOUND * sound , qboolean loop , qboolean paused )
{
FMOD_CHANNELGROUP * channelGroup ;
fmod_result = FMOD_System_GetMasterChannelGroup ( fmod_system , & channelGroup ) ;
FMOD_ERROR ( fmod_result , true , false ) ;
fmod_result = FMOD_System_PlaySound ( fmod_system , sound , channelGroup , ( FMOD_BOOL ) paused , & SND_MusicChannel . channel ) ;
fmod_result = FMOD_System_PlaySound ( fmod_system , sound , musicChannelGroup , ( FMOD_BOOL ) paused , & SND_MusicChannel . channel ) ;
FMOD_ERROR ( fmod_result , true , false ) ;
if ( ( SND_MusicChannel . looping = loop ) = = true )
@ -616,7 +587,7 @@ void MOD_Update (void)
if ( SND_MusicChannel . volume > 1.0f )
SND_MusicChannel . volume = 1.0f ;
FMOD_Channel_SetVolume ( SND_MusicChannel . channel , SND_MusicChannel . volume ) ;
FMOD_ChannelGroup _SetVolume ( musicChannelGroup , SND_MusicChannel . volume ) ;
if ( SND_MusicChannel . volume = = 0.0f )
MOD_Pause ( ) ;