Added A_SoundPitch and an optional pitch parameter to A_PlaySound and S_Sound.

- Note: Because sound channels are not in zscript, there's no way to modify a sound made by S_Sound.
This commit is contained in:
Major Cooke 2019-07-23 19:40:19 -05:00 committed by Christoph Oelckers
commit 15eabfd055
10 changed files with 144 additions and 30 deletions

View file

@ -142,6 +142,15 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, A_StopSound, NativeStopSound)
return 0;
}
DEFINE_ACTION_FUNCTION_NATIVE(AActor, A_SoundPitch, S_ChangeSoundPitch)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_INT(channel);
PARAM_FLOAT(pitch);
S_ChangeSoundPitch(self, channel, pitch);
return 0;
}
DEFINE_ACTION_FUNCTION_NATIVE(AActor, A_SoundVolume, S_ChangeSoundVolume)
{
PARAM_SELF_PROLOGUE(AActor);
@ -160,7 +169,8 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, A_PlaySound, A_PlaySound)
PARAM_BOOL(looping);
PARAM_FLOAT(attenuation);
PARAM_BOOL(local);
A_PlaySound(self, soundid, channel, volume, looping, attenuation, local);
PARAM_FLOAT(pitch);
A_PlaySound(self, soundid, channel, volume, looping, attenuation, local, pitch);
return 0;
}