Change LOAD_LEGACY_RENDERER_FOR_EDITOR from true -> false (#315)

Change LOAD_LEGACY_RENDERER_FOR_EDITOR from true -> false, and added some null checks to protect against gEnv->pRenderer and gEnv->p3DEngine now being null in the editor as well as the launcher.
This commit is contained in:
bosnichd
2021-04-26 13:15:32 -06:00
committed by GitHub
parent d27c43e595
commit e5b5067748
5 changed files with 52 additions and 21 deletions
@@ -525,6 +525,11 @@ void CMaterialManager::OnEditorNotifyEvent(EEditorNotifyEvent event)
//////////////////////////////////////////////////////////////////////////
void CMaterialManager::ReloadDirtyMaterials()
{
if (!GetIEditor()->Get3DEngine())
{
return;
}
IMaterialManager* runtimeMaterialManager = GetIEditor()->Get3DEngine()->GetMaterialManager();
uint32 mtlCount = 0;
@@ -743,12 +748,15 @@ int CMaterialManager::GetHighlightFlags(CMaterial* pMaterial) const
result |= eHighlight_NoSurfaceType;
}
if (ISurfaceTypeManager* pSurfaceManager = GetIEditor()->Get3DEngine()->GetMaterialManager()->GetSurfaceTypeManager())
if (GetIEditor()->Get3DEngine())
{
const ISurfaceType* pSurfaceType = pSurfaceManager->GetSurfaceTypeByName(surfaceTypeName.toUtf8().data());
if (pSurfaceType && pSurfaceType->GetBreakability() != 0)
if (ISurfaceTypeManager* pSurfaceManager = GetIEditor()->Get3DEngine()->GetMaterialManager()->GetSurfaceTypeManager())
{
result |= eHighlight_Breakable;
const ISurfaceType* pSurfaceType = pSurfaceManager->GetSurfaceTypeByName(surfaceTypeName.toUtf8().data());
if (pSurfaceType && pSurfaceType->GetBreakability() != 0)
{
result |= eHighlight_Breakable;
}
}
}