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
@@ -23,16 +23,18 @@ namespace Audio
eALT_ALWAYS,
};
enum EAudioLoggingOptions
{
eALO_NONE = 0,
eALO_ERRORS = AUDIO_BIT(6), // a
eALO_WARNINGS = AUDIO_BIT(7), // b
eALO_COMMENTS = AUDIO_BIT(8), // c
};
namespace Log
{
enum Options : AZ::u8
{
None = 0,
Errors = (1 << 0),
Warnings = (1 << 1),
Comments = (1 << 2),
};
inline AZ::u32 s_audioLogOptions = 0;
#if defined(ENABLE_AUDIO_LOGGING)
// Eventually will get rid of the CAudioLogger class and objects and convert
// all audio log calls to use Audio::Log::Print.
@@ -40,19 +42,6 @@ namespace Audio
// arguments in CAudioLogger::Log and call this PrintMsg.
inline void PrintMsg(const EAudioLogType type, const char* const message)
{
EAudioLoggingOptions logLevel = eALO_NONE;
auto verbosityVar = AZ::Environment::FindVariable<int*>("AudioLogVerbosity");
if (verbosityVar.IsConstructed())
{
logLevel = static_cast<EAudioLoggingOptions>(*(verbosityVar.Get()));
}
if (logLevel == eALO_NONE)
{
return;
}
static constexpr const char* AudioWindow = "Audio";
switch (type)
@@ -64,7 +53,7 @@ namespace Audio
}
case eALT_ERROR:
{
if (logLevel & eALO_ERRORS)
if ((s_audioLogOptions & Log::Options::Errors) != 0)
{
AZ_Error(AudioWindow, false, message);
}
@@ -72,7 +61,7 @@ namespace Audio
}
case eALT_WARNING:
{
if (logLevel & eALO_WARNINGS)
if ((s_audioLogOptions & Log::Options::Warnings) != 0)
{
AZ_Warning(AudioWindow, false, message);
}
@@ -80,7 +69,7 @@ namespace Audio
}
case eALT_COMMENT:
{
if (logLevel & eALO_COMMENTS)
if ((s_audioLogOptions & Log::Options::Comments) != 0)
{
AZ_TracePrintf(AudioWindow, message);
}