Skip to content

Commit

Permalink
Startup: AppContext - show error info if loading ogre.cfg fails.
Browse files Browse the repository at this point in the history
I tested OGRE13 branch recently and my ogre.cfg was incompatible - that's how I noticed this error reporting problem.
  • Loading branch information
ohlidalp committed Jul 9, 2023
1 parent 3facba6 commit fa36c62
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions source/main/AppContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,21 +253,30 @@ bool AppContext::SetUpRendering()
}
catch (Ogre::Exception&) {} // Logged by OGRE
}

}
catch (Ogre::Exception& e)
{
ErrorUtils::ShowError (_L("Startup error"), e.getFullDescription());
ErrorUtils::ShowError (_L("Startup error"), e.getDescription());
return false;
}

// Load renderer configuration
if (!m_ogre_root->restoreConfig())
try
{
const auto render_systems = App::GetAppContext()->GetOgreRoot()->getAvailableRenderers();
if (!render_systems.empty())
m_ogre_root->setRenderSystem(render_systems.front());
else
ErrorUtils::ShowError (_L("Startup error"), _L("No render system plugin available. Check your plugins.cfg"));
// Load renderer configuration
if (!m_ogre_root->restoreConfig())
{
const auto render_systems = App::GetAppContext()->GetOgreRoot()->getAvailableRenderers();
if (!render_systems.empty())
m_ogre_root->setRenderSystem(render_systems.front());
else
ErrorUtils::ShowError (_L("Startup error"), _L("No render system plugin available. Check your plugins.cfg"));
}
}
catch (Ogre::Exception& e)
{
ErrorUtils::ShowError (_L("Error restoring settings from 'ogre.cfg'"), e.getDescription());
return false;
}

const auto rs = m_ogre_root->getRenderSystemByName(App::app_rendersys_override->getStr());
Expand Down

0 comments on commit fa36c62

Please sign in to comment.