mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 15:02:01 +00:00
- Changed ambient sound things so that 100 volume is normal.
- The fifth argument for the ambient sound things is now a scalar for the min and max distances. SVN r2229 (trunk)
This commit is contained in:
parent
226a513e6e
commit
d012165f57
2 changed files with 11 additions and 3 deletions
|
@ -703,9 +703,10 @@ static int LoadSprites (spritetype *sprites, Xsprite *xsprites, int numsprites,
|
||||||
mapthings[count].args[0] = xsprites[i].Data3;
|
mapthings[count].args[0] = xsprites[i].Data3;
|
||||||
// I am totally guessing abount the volume level. 50 seems to be a pretty
|
// I am totally guessing abount the volume level. 50 seems to be a pretty
|
||||||
// typical value for Blood's standard maps, so I assume it's 100-based.
|
// typical value for Blood's standard maps, so I assume it's 100-based.
|
||||||
mapthings[count].args[1] = xsprites[i].Data4 * 128 / 100;
|
mapthings[count].args[1] = xsprites[i].Data4;
|
||||||
mapthings[count].args[2] = xsprites[i].Data1;
|
mapthings[count].args[2] = xsprites[i].Data1;
|
||||||
mapthings[count].args[3] = xsprites[i].Data2;
|
mapthings[count].args[3] = xsprites[i].Data2;
|
||||||
|
mapthings[count].args[4] = 0;
|
||||||
mapthings[count].type = 14065;
|
mapthings[count].type = 14065;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -1975,7 +1975,7 @@ void AAmbientSound::Tick ()
|
||||||
// The second argument scales the ambient sound's volume.
|
// The second argument scales the ambient sound's volume.
|
||||||
// 0 and 128 are normal volume. The maximum volume level
|
// 0 and 128 are normal volume. The maximum volume level
|
||||||
// possible is always 1.
|
// possible is always 1.
|
||||||
float volscale = args[1] == 0 ? 1 : args[1] / 128.f;
|
float volscale = args[1] == 0 ? 1 : args[1] / 100.f;
|
||||||
float usevol = clamp(ambient->volume * volscale, 0.f, 1.f);
|
float usevol = clamp(ambient->volume * volscale, 0.f, 1.f);
|
||||||
|
|
||||||
// The third argument is the minimum distance for audible fading, and
|
// The third argument is the minimum distance for audible fading, and
|
||||||
|
@ -1988,7 +1988,14 @@ void AAmbientSound::Tick ()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
S_SoundMinMaxDist(this, CHAN_BODY | loop, ambient->sound, usevol, float(args[2]), float(args[3]));
|
float min = float(args[2]), max = float(args[3]);
|
||||||
|
// The fifth argument acts as a scalar for the preceding two, if it's non-zero.
|
||||||
|
if (args[4] != 0)
|
||||||
|
{
|
||||||
|
min *= args[4];
|
||||||
|
max *= args[4];
|
||||||
|
}
|
||||||
|
S_SoundMinMaxDist(this, CHAN_BODY | loop, ambient->sound, usevol, min, max);
|
||||||
}
|
}
|
||||||
if (!loop)
|
if (!loop)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue