Added an optional extra float parameter to $pitchshift. (#1150)
- This allows for setting a randomized range for the pitch each time the sound is initialized.
This commit is contained in:
parent
5803b78147
commit
c57e669044
3 changed files with 31 additions and 2 deletions
|
|
@ -1039,13 +1039,21 @@ static void S_AddSNDINFO (int lump)
|
|||
break;
|
||||
|
||||
case SI_PitchSet: {
|
||||
// $pitchset <logical name> <pitch amount as float>
|
||||
// $pitchset <logical name> <pitch amount as float> [range maximum]
|
||||
int sfx;
|
||||
|
||||
sc.MustGetString();
|
||||
sfx = soundEngine->FindSoundTentative(sc.String);
|
||||
sc.MustGetFloat();
|
||||
S_sfx[sfx].DefPitch = (float)sc.Float;
|
||||
if (sc.CheckFloat())
|
||||
{
|
||||
S_sfx[sfx].DefPitchMax = (float)sc.Float;
|
||||
}
|
||||
else
|
||||
{
|
||||
S_sfx[sfx].DefPitchMax = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue