Removes some CryAssert methods that are not being used because we redirected it all to AZ_Assert

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-11-19 19:00:25 -08:00
parent 03543a9e8e
commit c00d3105c6
19 changed files with 10 additions and 1130 deletions
-53
View File
@@ -77,64 +77,11 @@ public:
bool OnPreAssert(const char* fileName, int line, const char* func, const char* message) override
{
#if defined(USE_CRY_ASSERT) && AZ_LEGACY_CRYSYSTEM_TRAIT_DO_PREASSERT
AZ::Crc32 crc;
crc.Add(&line, sizeof(line));
if (fileName)
{
crc.Add(fileName, strlen(fileName));
}
bool* ignore = nullptr;
auto foundIter = m_ignoredAsserts->find(crc);
if (foundIter == m_ignoredAsserts->end())
{
ignore = &((*m_ignoredAsserts)[crc]);
*ignore = false;
}
else
{
ignore = &((*m_ignoredAsserts)[crc]);
}
if (!(*ignore))
{
using namespace AZ::Debug;
Trace::Output(nullptr, "\n==================================================================\n");
AZ::OSString outputMsg = AZ::OSString::format("Trace::Assert\n %s(%d): '%s'\n%s\n", fileName, line, func, message);
Trace::Output(nullptr, outputMsg.c_str());
// Suppress 3 in stack depth - this function, the bus broadcast that got us here, and Trace::Assert
Trace::Output(nullptr, "------------------------------------------------\n");
Trace::PrintCallstack(nullptr, 3);
Trace::Output(nullptr, "\n==================================================================\n");
AZ::EnvironmentVariable<bool> inEditorBatchMode = AZ::Environment::FindVariable<bool>("InEditorBatchMode");
if (!inEditorBatchMode.IsConstructed() || !inEditorBatchMode.Get())
{
// Note - CryAssertTrace doesn't actually print any info to logging
// it just stores the message internally for the message box in CryAssert to use
CryAssertTrace("%s", message);
if (CryAssert("Assertion failed", fileName, line, ignore) || Trace::IsDebuggerPresent())
{
Trace::Break();
}
}
}
else
{
CryLogAlways("%s", message);
}
return m_suppressSystemOutput;
#else
AZ_UNUSED(fileName);
AZ_UNUSED(line);
AZ_UNUSED(func);
AZ_UNUSED(message);
return false; // allow AZCore to do its default behavior. This usually results in an application shutdown.
#endif
}
bool OnPreError(const char* window, const char* fileName, int line, const char* func, const char* message) override
+1 -4
View File
@@ -1280,10 +1280,7 @@ void CSystem::RegisterWindowMessageHandler(IWindowMessageHandler* pHandler)
void CSystem::UnregisterWindowMessageHandler(IWindowMessageHandler* pHandler)
{
#if AZ_LEGACY_CRYSYSTEM_TRAIT_USE_MESSAGE_HANDLER
#if !defined(NDEBUG)
bool bRemoved =
#endif
stl::find_and_erase(m_windowMessageHandlers, pHandler);
[[maybe_unused]] bool bRemoved = stl::find_and_erase(m_windowMessageHandlers, pHandler);
assert(pHandler && bRemoved && "This IWindowMessageHandler was not registered");
#else
CRY_ASSERT(false && "This platform does not support window message handlers");
-7
View File
@@ -53,11 +53,6 @@ class CWatchdogThread;
#define AZ_LEGACY_CRYSYSTEM_TRAIT_ALLOW_CREATE_BACKUP_LOG_FILE 1
#endif
//////////////////////////////////////////////////////////////////////////
#if defined(WIN32) || defined(APPLE) || defined(LINUX)
#define AZ_LEGACY_CRYSYSTEM_TRAIT_DO_PREASSERT 1
#endif
#if defined(LINUX) || defined(APPLE)
#define AZ_LEGACY_CRYSYSTEM_TRAIT_FORWARD_EXCEPTION_POINTERS 1
#endif
@@ -72,9 +67,7 @@ class CWatchdogThread;
#define AZ_LEGACY_CRYSYSTEM_TRAIT_DEBUGCALLSTACK_APPEND_MODULENAME 1
#endif
#if 1
#define AZ_LEGACY_CRYSYSTEM_TRAIT_USE_EXCLUDEUPDATE_ON_CONSOLE 0
#endif
#if defined(WIN32)
#define AZ_LEGACY_CRYSYSTEM_TRAIT_USE_MESSAGE_HANDLER 1
#endif