- copied $pitchset SNDINFO command from GZDoom.

This commit is contained in:
Christoph Oelckers 2023-01-15 12:22:07 +01:00
parent 8de7aa5975
commit 8859712a7b

View file

@ -59,6 +59,7 @@ enum SICommands
SI_Alias, SI_Alias,
SI_Limit, SI_Limit,
SI_Singular, SI_Singular,
SI_PitchSet,
SI_DukePitchRange, SI_DukePitchRange,
SI_DukeFlags, SI_DukeFlags,
}; };
@ -91,6 +92,7 @@ static const char *SICommandStrings[] =
"$alias", "$alias",
"$limit", "$limit",
"$singular", "$singular",
"$pitchset",
"$dukepitchrange", "$dukepitchrange",
"$dukeflags", "$dukeflags",
NULL NULL
@ -293,6 +295,26 @@ static void S_AddSNDINFO (int lump)
} }
break; break;
case SI_PitchSet: {
// $pitchset <logical name> <pitch amount as float> [range maximum]
FSoundID sfx;
sc.MustGetString();
sfx = soundEngine->FindSoundTentative(sc.String);
sc.MustGetFloat();
auto sfxp = soundEngine->GetWritableSfx(sfx);
sfxp->DefPitch = (float)sc.Float;
if (sc.CheckFloat())
{
sfxp->DefPitchMax = (float)sc.Float;
}
else
{
sfxp->DefPitchMax = 0;
}
}
break;
case SI_ConReserve: { case SI_ConReserve: {
// $conreserve <logical name> <resource id> // $conreserve <logical name> <resource id>