mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Normalize all volume scales to 0-100
This commit is contained in:
parent
86990d47d2
commit
610351b872
3 changed files with 13 additions and 13 deletions
|
|
@ -748,10 +748,10 @@ extern int
|
||||||
/// Render flats on walls
|
/// Render flats on walls
|
||||||
#define WALLFLATS
|
#define WALLFLATS
|
||||||
|
|
||||||
/// Divide volume of music and sounds by this much (loudest sounds on earth)
|
// Volume scale is 0-100 in new mixer. 100 is treated as -0dB or 100% gain. No more weirdness to work around SDL_mixer
|
||||||
#define VOLUME_DIVIDER 4
|
// problems
|
||||||
#define USER_VOLUME_SCALE 2
|
|
||||||
#define MAX_VOLUME ( 100 * VOLUME_DIVIDER / USER_VOLUME_SCALE )
|
#define MAX_VOLUME 100
|
||||||
|
|
||||||
#ifdef HAVE_CURL
|
#ifdef HAVE_CURL
|
||||||
#define MASTERSERVER
|
#define MASTERSERVER
|
||||||
|
|
|
||||||
|
|
@ -72,8 +72,8 @@ consvar_t stereoreverse = CVAR_INIT ("stereoreverse", "Off", CV_SAVE, CV_OnOff,
|
||||||
static consvar_t precachesound = CVAR_INIT ("precachesound", "Off", CV_SAVE, CV_OnOff, NULL);
|
static consvar_t precachesound = CVAR_INIT ("precachesound", "Off", CV_SAVE, CV_OnOff, NULL);
|
||||||
|
|
||||||
// actual general (maximum) sound & music volume, saved into the config
|
// actual general (maximum) sound & music volume, saved into the config
|
||||||
consvar_t cv_soundvolume = CVAR_INIT ("soundvolume", "50", CV_SAVE, soundvolume_cons_t, NULL);
|
consvar_t cv_soundvolume = CVAR_INIT ("soundvolume", "80", CV_SAVE, soundvolume_cons_t, NULL);
|
||||||
consvar_t cv_digmusicvolume = CVAR_INIT ("musicvolume", "50", CV_SAVE, soundvolume_cons_t, NULL);
|
consvar_t cv_digmusicvolume = CVAR_INIT ("musicvolume", "80", CV_SAVE, soundvolume_cons_t, NULL);
|
||||||
|
|
||||||
// number of channels available
|
// number of channels available
|
||||||
consvar_t cv_numChannels = CVAR_INIT ("snd_channels", "64", CV_SAVE|CV_CALL, CV_Unsigned, SetChannelsNum);
|
consvar_t cv_numChannels = CVAR_INIT ("snd_channels", "64", CV_SAVE|CV_CALL, CV_Unsigned, SetChannelsNum);
|
||||||
|
|
@ -791,9 +791,9 @@ void S_UpdateSounds(void)
|
||||||
mobj_t *listenmobj[MAXSPLITSCREENPLAYERS];
|
mobj_t *listenmobj[MAXSPLITSCREENPLAYERS];
|
||||||
|
|
||||||
// Update sound/music volumes, if changed manually at console
|
// Update sound/music volumes, if changed manually at console
|
||||||
if (actualsfxvolume != cv_soundvolume.value * USER_VOLUME_SCALE)
|
if (actualsfxvolume != cv_soundvolume.value)
|
||||||
S_SetSfxVolume (cv_soundvolume.value);
|
S_SetSfxVolume (cv_soundvolume.value);
|
||||||
if (actualdigmusicvolume != cv_digmusicvolume.value * USER_VOLUME_SCALE)
|
if (actualdigmusicvolume != cv_digmusicvolume.value)
|
||||||
S_SetDigMusicVolume (cv_digmusicvolume.value);
|
S_SetDigMusicVolume (cv_digmusicvolume.value);
|
||||||
|
|
||||||
// We're done now, if we're not in a level.
|
// We're done now, if we're not in a level.
|
||||||
|
|
@ -990,7 +990,7 @@ void S_UpdateClosedCaptions(void)
|
||||||
void S_SetSfxVolume(INT32 volume)
|
void S_SetSfxVolume(INT32 volume)
|
||||||
{
|
{
|
||||||
//CV_SetValue(&cv_soundvolume, volume);
|
//CV_SetValue(&cv_soundvolume, volume);
|
||||||
actualsfxvolume = volume * USER_VOLUME_SCALE;
|
actualsfxvolume = volume;
|
||||||
|
|
||||||
#ifdef HW3SOUND
|
#ifdef HW3SOUND
|
||||||
hws_mode == HWS_DEFAULT_MODE ? I_SetSfxVolume(volume&0x1F) : HW3S_SetSfxVolume(volume&0x1F);
|
hws_mode == HWS_DEFAULT_MODE ? I_SetSfxVolume(volume&0x1F) : HW3S_SetSfxVolume(volume&0x1F);
|
||||||
|
|
@ -2350,7 +2350,7 @@ void S_SetMusicVolume(INT32 digvolume)
|
||||||
digvolume = cv_digmusicvolume.value;
|
digvolume = cv_digmusicvolume.value;
|
||||||
|
|
||||||
//CV_SetValue(&cv_digmusicvolume, digvolume);
|
//CV_SetValue(&cv_digmusicvolume, digvolume);
|
||||||
actualdigmusicvolume = digvolume * USER_VOLUME_SCALE;
|
actualdigmusicvolume = digvolume;
|
||||||
I_SetMusicVolume(digvolume);
|
I_SetMusicVolume(digvolume);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,10 +35,10 @@ extern openmpt_module *openmpt_mhandle;
|
||||||
#define PICKUP_SOUND 0x8000
|
#define PICKUP_SOUND 0x8000
|
||||||
|
|
||||||
//
|
//
|
||||||
#define SOUND_VOLUME_RANGE 256
|
#define SOUND_VOLUME_RANGE 100
|
||||||
#define MAX_SOUND_VOLUME 255
|
#define MAX_SOUND_VOLUME 100
|
||||||
|
|
||||||
#define DEFAULT_MUSICDEF_VOLUME ( 100 / VOLUME_DIVIDER )
|
#define DEFAULT_MUSICDEF_VOLUME 100
|
||||||
|
|
||||||
extern consvar_t stereoreverse;
|
extern consvar_t stereoreverse;
|
||||||
extern consvar_t cv_soundvolume, cv_closedcaptioning, cv_digmusicvolume;
|
extern consvar_t cv_soundvolume, cv_closedcaptioning, cv_digmusicvolume;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue