Added Actor.A_SoundVolume(int slot, double volume) function to ZScript

https://forum.zdoom.org/viewtopic.php?t=57594
This commit is contained in:
alexey.lysiuk 2017-08-31 09:45:09 +03:00
parent 77faab5a75
commit ca55d8993f
2 changed files with 10 additions and 0 deletions

View file

@ -979,6 +979,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_StopSound)
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_SoundVolume)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_INT(channel);
PARAM_FLOAT(volume);
S_ChangeSoundVolume(self, channel, static_cast<float>(volume));
return 0;
}
//==========================================================================
//
// These come from a time when DECORATE constants did not exist yet and

View file

@ -1000,6 +1000,7 @@ class Actor : Thinker native
deprecated("2.3") native void A_BulletAttack();
native void A_WolfAttack(int flags = 0, sound whattoplay = "weapons/pistol", double snipe = 1.0, int maxdamage = 64, int blocksize = 128, int pointblank = 2, int longrange = 4, double runspeed = 160.0, class<Actor> pufftype = "BulletPuff");
native void A_PlaySound(sound whattoplay = "weapons/pistol", int slot = CHAN_BODY, double volume = 1.0, bool looping = false, double attenuation = ATTN_NORM, bool local = false);
native void A_SoundVolume(int slot, double volume);
deprecated("2.3") void A_PlayWeaponSound(sound whattoplay) { A_PlaySound(whattoplay, CHAN_WEAPON); }
native void A_StopSound(int slot = CHAN_VOICE); // Bad default but that's what is originally was...
deprecated("2.3") native void A_PlaySoundEx(sound whattoplay, name slot, bool looping = false, int attenuation = 0);