mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2024-10-28 03:09:36 +01:00
Make the dB scale option 0 instead of the linear scale
This commit is contained in:
parent
a7c59b13c6
commit
6082a88511
3 changed files with 11 additions and 11 deletions
10
mkxp.json
10
mkxp.json
|
@ -468,14 +468,14 @@
|
|||
// "YJITEnable": false,
|
||||
|
||||
// Determines how the volume value of a sound affects how loud the sound is.
|
||||
// The stock RPG Maker runtimes use a 35 dB scale for volume (option 1),
|
||||
// The stock RPG Maker runtimes use a 35 dB scale for volume (option 0),
|
||||
// but other runtimes might use a different scale.
|
||||
// 0: linear (sound amplitude is multiplied by the volume)
|
||||
// 1: 35 dB (a gain of -0.35 dB is applied to the sound for every percent
|
||||
// 0: 35 dB (a gain of -0.35 dB is applied to the sound for every percent
|
||||
// the volume is set below 100%)
|
||||
// (default: 1)
|
||||
// 1: linear (sound amplitude is multiplied by the volume)
|
||||
// (default: 0)
|
||||
//
|
||||
// "volumeScale": 1,
|
||||
// "volumeScale": 0,
|
||||
|
||||
// SoundFont to use for midi playback (via fluidsynth)
|
||||
// (default: none)
|
||||
|
|
|
@ -170,20 +170,20 @@ namespace Source
|
|||
|
||||
enum VolumeScale
|
||||
{
|
||||
Linear = 0,
|
||||
Db35 = 1,
|
||||
Db35 = 0,
|
||||
Linear = 1,
|
||||
};
|
||||
|
||||
inline void setVolume(Source::ID id, float value, VolumeScale scale)
|
||||
{
|
||||
switch (scale) {
|
||||
case VolumeScale::Db35:
|
||||
case Linear:
|
||||
break;
|
||||
default:
|
||||
if (value > FLT_EPSILON) {
|
||||
value = std::powf(10.0f, -(35.0f / 20.0f) * (1.0f - value));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
alSourcef(id.al, AL_GAIN, value * 0.8f);
|
||||
}
|
||||
|
|
|
@ -178,7 +178,7 @@ void Config::read(int argc, char *argv[]) {
|
|||
{"dataPathApp", ""},
|
||||
{"iconPath", ""},
|
||||
{"execName", "Game"},
|
||||
{"volumeScale", 1},
|
||||
{"volumeScale", 0},
|
||||
{"midiSoundFont", ""},
|
||||
{"midiChorus", false},
|
||||
{"midiReverb", false},
|
||||
|
|
Loading…
Reference in a new issue