From 842e8b68b4f56eb78f427b28356f6732e157acbc Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 12 Jun 2017 00:00:55 +0200 Subject: [PATCH 1/2] - blacklist old FMod related sound CVARs because they tend to be in the UnknownCVARs section but aren't useful any longer. --- src/menu/menudef.cpp | 18 ++++++++++++++---- src/namedef.h | 8 +++++++- src/sound/i_sound.cpp | 1 - 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/menu/menudef.cpp b/src/menu/menudef.cpp index e3184d316..952657ead 100644 --- a/src/menu/menudef.cpp +++ b/src/menu/menudef.cpp @@ -537,6 +537,7 @@ static bool FindMatchingItem(DMenuItemBase *desc) if (grp == 5) return true; // static texts always match FName name = desc->mAction; + if (grp == 1) { // Check for presence of menu @@ -545,9 +546,17 @@ static bool FindMatchingItem(DMenuItemBase *desc) } else if (grp == 4) { + static const FName CVarBlacklist[] = { + NAME_snd_waterlp, NAME_snd_output, NAME_snd_output_format, NAME_snd_speakermode, NAME_snd_resampler, NAME_AlwaysRun }; + // Check for presence of CVAR and blacklist - auto cv = GetCVar(nullptr, name.GetChars()); + auto cv = FindCVar(name.GetChars(), nullptr); if (cv == nullptr) return true; + + for (auto bname : CVarBlacklist) + { + if (name == bname) return true; + } } MenuDescriptorList::Iterator it(MenuDescriptors); @@ -585,15 +594,16 @@ static bool ReplaceMenu(FScanner &sc, DMenuDescriptor *desc) } if (desc->mItems.Size() > 0) { - auto sep = CreateOptionMenuItemStaticText("---------------", CR_YELLOW); + auto sep = CreateOptionMenuItemStaticText(" "); + (*pOld)->mItems.Push(sep); + auto sep = CreateOptionMenuItemStaticText("---------------", 1); (*pOld)->mItems.Push(sep); for (auto it : desc->mItems) { (*pOld)->mItems.Push(it); } desc->mItems.Clear(); - - sc.ScriptMessage("Merged %d items into %s", desc->mItems.Size(), desc->mMenuName.GetChars()); + //sc.ScriptMessage("Merged %d items into %s", desc->mItems.Size(), desc->mMenuName.GetChars()); } return true; } diff --git a/src/namedef.h b/src/namedef.h index 3d8fd684f..5ba5bafd1 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -937,4 +937,10 @@ xx(OptionMenuFieldBase) xx(OptionMenuItemColorPicker) xx(OptionMenuItemStaticText) xx(OptionMenuItemStaticTextSwitchable) -xx(mAction) + +// blacklisted former CVARs +xx(snd_waterlp) +xx(snd_output) +xx(snd_output_format) +xx(snd_speakermode) +xx(snd_resampler) diff --git a/src/sound/i_sound.cpp b/src/sound/i_sound.cpp index 661af0270..562945d19 100644 --- a/src/sound/i_sound.cpp +++ b/src/sound/i_sound.cpp @@ -65,7 +65,6 @@ 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, -1, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) #if !defined(NO_OPENAL) From 2ff492d005ede2966671bb927143e0feefd4d4bb Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Mon, 12 Jun 2017 00:38:50 -0400 Subject: [PATCH 2/2] - fix compile on Windows --- src/menu/menudef.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/menu/menudef.cpp b/src/menu/menudef.cpp index 952657ead..e7818d849 100644 --- a/src/menu/menudef.cpp +++ b/src/menu/menudef.cpp @@ -596,7 +596,7 @@ static bool ReplaceMenu(FScanner &sc, DMenuDescriptor *desc) { auto sep = CreateOptionMenuItemStaticText(" "); (*pOld)->mItems.Push(sep); - auto sep = CreateOptionMenuItemStaticText("---------------", 1); + sep = CreateOptionMenuItemStaticText("---------------", 1); (*pOld)->mItems.Push(sep); for (auto it : desc->mItems) {