Changes

From DoomWiki.org

Sound effects behave differently on level 8

No change in size, 23:53, 22 March 2012
m
vanilla
This is the code which decreases the volume of sound effects with distance. A different calculation is used here for level 8. A value of 15 is always added to the volume, so that it is always above zero.
=== Differences between Vanilla vanilla Doom and the released source ===
Examination of the released [[Doom source code]] can be misleading because of a change made to the sound code before the source release. In Vanilla vanilla Doom, there are two variables which hold the sound effect volume. One of these is named "sfxVolume", and has a range of 0-15. This is the value stored in the configuration file and controlled via the sound volume screen.
The second variable is internal to the sound subsystem (snd_SfxVolume in the above code fragment). Unlike sfxVolume this has a range of 0-127. The menu updates this internal variable by calling ''S_SetSfxVolume'' to inform the sound subsystem of volume changes. Before the source code release, the two variables were combined into a single variable named ''snd_SfxVolume'', having a range of 0-15.
S_SetSfxVolume(snd_SfxVolume /* *8 */);
The commented-out multiply-by-8 was needed in Vanilla vanilla Doom to convert from the 0-15 to 0-127 range, but after the two variables were merged, became useless. ''S_SetSfxVolume'' itself still checks values are in the range 0-127, although it should be noted that the function essentially became pointless after the change.
[[Category:Errors and bugs]]
[[Category:Audio]]
7,722
edits