From 6044c876ab8f43e9e43217d5a23e239f2cbb6767 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 30 Apr 2017 12:01:38 -0700 Subject: [PATCH] Update LASTRUNVERSION to handle the snd_hrtf change Also snd_hrtf now uses -1 for "auto" and 0 for "off", which makes more sense. --- src/gameconfigfile.cpp | 8 ++++++-- src/sound/i_sound.cpp | 2 +- src/sound/oalsound.cpp | 2 +- src/version.h | 2 +- wadsrc/static/menudef.txt | 8 ++++---- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/gameconfigfile.cpp b/src/gameconfigfile.cpp index ad9a87b20..cfbbe5fb7 100644 --- a/src/gameconfigfile.cpp +++ b/src/gameconfigfile.cpp @@ -378,9 +378,13 @@ void FGameConfigFile::DoGlobalSetup () if (var != NULL) var->ResetToDefault(); var = FindCVar("uiscale", NULL); if (var != NULL) var->ResetToDefault(); - } - + if (last < 215) + { + // Previously a true/false boolean. Now an on/off/auto tri-state with auto as the default. + FBaseCVar *var = FindCVar("snd_hrtf", NULL); + if (var != NULL) var->ResetToDefault(); + } } } } diff --git a/src/sound/i_sound.cpp b/src/sound/i_sound.cpp index f80ec6865..054062033 100644 --- a/src/sound/i_sound.cpp +++ b/src/sound/i_sound.cpp @@ -66,7 +66,7 @@ EXTERN_CVAR (Float, snd_sfxvolume) CVAR (Int, snd_samplerate, 0, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CVAR (Int, snd_buffersize, 0, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CVAR (String, snd_output, "default", CVAR_ARCHIVE|CVAR_GLOBALCONFIG) -CVAR (Int, snd_hrtf, 0, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) +CVAR (Int, snd_hrtf, -1, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) #if !defined(NO_OPENAL) #define DEF_BACKEND "openal" diff --git a/src/sound/oalsound.cpp b/src/sound/oalsound.cpp index b1235dfdd..1354bb679 100644 --- a/src/sound/oalsound.cpp +++ b/src/sound/oalsound.cpp @@ -756,7 +756,7 @@ OpenALSoundRenderer::OpenALSoundRenderer() if(ALC.SOFT_HRTF) { attribs.Push(ALC_HRTF_SOFT); - if(*snd_hrtf < 0) + if(*snd_hrtf == 0) attribs.Push(ALC_FALSE); else if(*snd_hrtf > 0) attribs.Push(ALC_TRUE); diff --git a/src/version.h b/src/version.h index f4b755579..cc4c9ed36 100644 --- a/src/version.h +++ b/src/version.h @@ -68,7 +68,7 @@ const char *GetVersionString(); // Version stored in the ini's [LastRun] section. // Bump it if you made some configuration change that you want to // be able to migrate in FGameConfigFile::DoGlobalSetup(). -#define LASTRUNVERSION "214" +#define LASTRUNVERSION "215" // Protocol version used in demos. // Bump it if you change existing DEM_ commands or add new ones. diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 12e54978a..5bc698684 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -309,10 +309,10 @@ OptionValue "OffOn" 1, "$OPTVAL_OFF" } -OptionValue OffAutoOn +OptionValue AutoOffOn { - -1, "$OPTVAL_OFF" - 0, "$OPTVAL_AUTO" + -1, "$OPTVAL_AUTO" + 0, "$OPTVAL_OFF" 1, "$OPTVAL_ON" } @@ -1636,7 +1636,7 @@ OptionMenu AdvSoundOptions { Title "$ADVSNDMNU_TITLE" Option "$ADVSNDMNU_SAMPLERATE", "snd_samplerate", "SampleRates" - Option "$ADVSNDMNU_HRTF", "snd_hrtf", "OffAutoOn" + Option "$ADVSNDMNU_HRTF", "snd_hrtf", "AutoOffOn" StaticText " " StaticText "$ADVSNDMNU_OPLSYNTHESIS", 1 Slider "$ADVSNDMNU_OPLNUMCHIPS", "opl_numchips", 1, 8, 1, 0