[Exception] Fix crash caused by drawing DEBUG text when no graphics initialized.

This commit is contained in:
/dev/urandom 2017-06-01 02:13:39 +02:00
parent 17ae11544d
commit c639f232f9
No known key found for this signature in database
GPG Key ID: 41322B973E0F295E

View File

@ -174,6 +174,7 @@ namespace Components
#ifdef DEBUG #ifdef DEBUG
// Display DEBUG branding, so we know we're on a debug build // Display DEBUG branding, so we know we're on a debug build
if (!Dedicated::IsEnabled() && !ZoneBuilder::IsEnabled()) {
Scheduler::OnFrame([]() Scheduler::OnFrame([]()
{ {
Game::Font* font = Game::R_RegisterFont("fonts/normalFont", 0); Game::Font* font = Game::R_RegisterFont("fonts/normalFont", 0);
@ -189,6 +190,7 @@ namespace Components
Game::R_AddCmdDrawText("DEBUG-BUILD", 0x7FFFFFFF, font, 15.0f, 10.0f + Game::R_TextHeight(font), 1.0f, 1.0f, 0.0f, color, Game::ITEM_TEXTSTYLE_SHADOWED); Game::R_AddCmdDrawText("DEBUG-BUILD", 0x7FFFFFFF, font, 15.0f, 10.0f + Game::R_TextHeight(font), 1.0f, 1.0f, 0.0f, color, Game::ITEM_TEXTSTYLE_SHADOWED);
}); });
}
#endif #endif
#if !defined(DEBUG) || defined(FORCE_EXCEPTION_HANDLER) #if !defined(DEBUG) || defined(FORCE_EXCEPTION_HANDLER)
Exception::SetFilterHook.initialize(SetUnhandledExceptionFilter, Exception::SetUnhandledExceptionFilterStub, HOOK_JUMP); Exception::SetFilterHook.initialize(SetUnhandledExceptionFilter, Exception::SetUnhandledExceptionFilterStub, HOOK_JUMP);