Update audio cvars from legacy to AZ_CVARs (#2182)
* Upgrade s_AudioLoggingOptions to AZ_CVAR Removes this legacy CVar and reimplements it as an AZ_CVAR with similar functionality of setting flags using alpha characters. Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com> * Upgrade s_DrawAudioDebug to AZ_CVAR Removes the legacy CVar and reimplements it as an AZ_CVAR with similar functionality and options. Additional updates to the logging options CVar to fix up flag enums. Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com> * Upgrade s_FileCacheManagerDebugFilter to AZ_CVAR Removes the legacy CVar and reimplements it as an AZ_CVAR with similar functionality. Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com> * Removal of legacy IConsole dependencies from Audio Moves a g_languageAudio cvar from CrySystem to AudioSystem. Convert all cvar commands to AZ_CONSOLEFREEFUNC's. Remove IConsole.h includes from source files. Removes the CSoundCVars class. Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com> * Minor update to cvar comments etc. Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>
This commit is contained in:
@@ -892,16 +892,19 @@ void CSystem::InitLocalization()
|
||||
OpenLanguagePak(language);
|
||||
}
|
||||
|
||||
pCVar = m_env.pConsole != 0 ? m_env.pConsole->GetCVar("g_languageAudio") : 0;
|
||||
if (pCVar)
|
||||
if (auto console = AZ::Interface<AZ::IConsole>::Get(); console != nullptr)
|
||||
{
|
||||
if (strlen(pCVar->GetString()) == 0)
|
||||
AZ::CVarFixedString languageAudio;
|
||||
if (auto result = console->GetCvarValue("g_languageAudio", languageAudio); result == AZ::GetValueResult::Success)
|
||||
{
|
||||
pCVar->Set(language);
|
||||
}
|
||||
else
|
||||
{
|
||||
language = pCVar->GetString();
|
||||
if (languageAudio.size() == 0)
|
||||
{
|
||||
console->PerformCommand(AZStd::string::format("g_languageAudio %s", language.c_str()).c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
language.assign(languageAudio.data(), languageAudio.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
OpenLanguageAudioPak(language);
|
||||
@@ -2079,7 +2082,6 @@ void CSystem::CreateSystemVars()
|
||||
|
||||
//Defines selected language.
|
||||
REGISTER_STRING_CB("g_language", "", VF_NULL, "Defines which language pak is loaded", CSystem::OnLanguageCVarChanged);
|
||||
REGISTER_STRING_CB("g_languageAudio", "", VF_NULL, "Will automatically match g_language setting unless specified otherwise", CSystem::OnLanguageAudioCVarChanged);
|
||||
|
||||
#if defined(WIN32)
|
||||
REGISTER_CVAR2("sys_display_threads", &g_cvars.sys_display_threads, 0, 0, "Displays Thread info");
|
||||
|
||||
Reference in New Issue
Block a user