- Added SNDINFO $attenuation command. This multiplies the attenuation passed to S_Sound. e.g.

$attenuation Boom 0
  Will make the "Boom" sound play with 0 attenuation, or in other words, at full volume throughout
  the level.

SVN r3629 (trunk)
This commit is contained in:
Randy Heit 2012-05-07 01:16:56 +00:00
commit 45027e4620
3 changed files with 20 additions and 1 deletions

View file

@ -152,6 +152,7 @@ enum SICommands
SI_Volume,
SI_MusicAlias,
SI_EDFOverride,
SI_Attenuation,
};
// Blood was a cool game. If Monolith ever releases the source for it,
@ -247,6 +248,7 @@ static const char *SICommandStrings[] =
"$volume",
"$musicalias",
"$edfoverride",
"$attenuation",
NULL
};
@ -501,6 +503,7 @@ int S_AddSoundLump (const char *logicalname, int lump)
newsfx.next = 0;
newsfx.index = 0;
newsfx.Volume = 1;
newsfx.Attenuation = 1;
newsfx.PitchMask = CurrentPitchMask;
newsfx.NearLimit = 2;
newsfx.LimitRange = 256*256;
@ -1204,6 +1207,17 @@ static void S_AddSNDINFO (int lump)
}
break;
case SI_Attenuation: {
// $attenuation <logical name> <attenuation>
int sfx;
sc.MustGetString();
sfx = S_FindSoundTentative(sc.String);
sc.MustGetFloat();
S_sfx[sfx].Attenuation = (float)sc.Float;
}
break;
case SI_Rolloff: {
// $rolloff *|<logical name> [linear|log|custom] <min dist> <max dist/rolloff factor>
// Using * for the name makes it the default for sounds that don't specify otherwise.