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:
amzn-phist
2021-07-16 12:25:32 -05:00
committed by GitHub
parent 23e22dbb4c
commit 4407891740
14 changed files with 511 additions and 535 deletions
@@ -17,7 +17,6 @@
#include <AudioLogger.h>
#include <AudioSystem.h>
#include <NullAudioSystem.h>
#include <SoundCVars.h>
#if defined(AUDIO_SYSTEM_EDITOR)
#include <AzToolsFramework/API/ToolsApplicationAPI.h>
@@ -29,9 +28,7 @@
namespace Audio
{
// Module globals/statics
CSoundCVars g_audioCVars;
CAudioLogger g_audioLogger;
AZ::EnvironmentVariable<int*> g_audioVerbosityVar;
namespace Platform
{
@@ -134,13 +131,6 @@ namespace AudioSystemGem
return CreateNullAudioSystem();
}
g_audioCVars.RegisterVariables();
#if !defined(AUDIO_RELEASE)
g_audioVerbosityVar = AZ::Environment::CreateVariable<int*>("AudioLogVerbosity");
g_audioVerbosityVar.Set(&g_audioCVars.m_nAudioLoggingOptions);
#endif // !AUDIO_RELEASE
bool success = false;
if (CreateAudioSystem())
@@ -191,9 +181,6 @@ namespace AudioSystemGem
// It should be the last object that is freed from the audio system memory pool before the allocator is destroyed.
m_audioSystem.reset();
g_audioVerbosityVar.Reset();
g_audioCVars.UnregisterVariables();
GetISystem()->GetISystemEventDispatcher()->RemoveListener(this);
}