// allocates channel buffer, sets S_sfx lookup.
//
void S_Init ( int
int
{
int
fprintf( stderr, "S_Init: default sfx volume %d\n", sfxVolume);
// Whatever these did with DMX, these are rather dummies now. I_SetChannels();
S_SetSfxVolume(sfxVolume);
//No music with Linux - another dummy. S_SetMusicVolume(musicVolume);
//Allocating the internal channels for mixing
//(the maximum numer of sounds rendered
//simultaneously) within zone memory. channels =
(channel_t *) Z_Malloc(numChannels*sizeof(channel_t), PU_STATIC, 0);
//Free all channels for use
for (i=0 ; i<numChannels ; i++) channels[i].sfxinfo = 0;
//no sounds are playing, and they are not mus_paused mus_paused = 0;
//Note that sounds have not been cached (yet).
for (i=1 ; i<NUMSFX ; i++)
S_sfx[i].lumpnum = S_sfx[i].usefulness = -1;
}
//
//Per level startup code.
//Kills playing sounds at start of level,
//determines music if any, changes music.
void S_Start(void)
{
int cnum; int mnum;
//kill all playing sounds at start of level
//(trust me - a good idea)
for (cnum=0 ; cnum<numChannels ; cnum++) if (channels[cnum].sfxinfo)
S_StopChannel(cnum);
// start new music for the level mus_paused = 0;
if (gamemode == commercial)
mnum = mus_runnin + gamemap - 1; else
{
int spmus[]=
{
// Song - Who? - Where?