- Added S_ChangeSoundVolume() to change the volume of an already playing sound, accessible

through the new ACS function SoundVolume.

SVN r4318 (trunk)
This commit is contained in:
Randy Heit 2013-06-01 17:46:50 +00:00
commit 1b9c71b252
7 changed files with 73 additions and 1 deletions

View file

@ -1592,6 +1592,29 @@ void S_RelinkSound (AActor *from, AActor *to)
}
}
//==========================================================================
//
// S_ChangeSoundVolume
//
//==========================================================================
bool S_ChangeSoundVolume(AActor *actor, int channel, float volume)
{
for (FSoundChan *chan = Channels; chan != NULL; chan = chan->NextChan)
{
if (chan->SourceType == SOURCE_Actor &&
chan->Actor == actor &&
(chan->EntChannel == channel || (i_compatflags & COMPATF_MAGICSILENCE)))
{
GSnd->ChannelVolume(chan, volume);
chan->Volume = volume;
return true;
}
}
return false;
}
//==========================================================================
//
// S_GetSoundPlayingInfo
@ -2136,7 +2159,6 @@ void S_StopChannel(FSoundChan *chan)
}
}
//==========================================================================
//
// (FArchive &) << (FSoundID &)