Remove I3DEngine CryCommon Interface (#567)
Delete: - I3DEngine - Missions - Time of day - GameEffectsSystem Gem - ImageProcessing Gem - SVOGI Gem - Various other things that don't do anything now that the legacy renderer has been removed.
This commit is contained in:
@@ -193,10 +193,6 @@ static void UnloadMap([[maybe_unused]] IConsoleCmdArgs* args)
|
||||
if (gEnv->pSystem && gEnv->pSystem->GetILevelSystem() && !gEnv->IsEditor())
|
||||
{
|
||||
gEnv->pSystem->GetILevelSystem()->UnloadLevel();
|
||||
if (gEnv->p3DEngine)
|
||||
{
|
||||
gEnv->p3DEngine->LoadEmptyLevel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -674,18 +670,6 @@ ILevel* CLevelSystem::LoadLevelInternal(const char* _levelName)
|
||||
pSpamDelay->Set(0.0f);
|
||||
}
|
||||
|
||||
if (gEnv->p3DEngine)
|
||||
{
|
||||
bool is3DEngineLoaded = gEnv->IsEditor() ? gEnv->p3DEngine->InitLevelForEditor(pLevelInfo->GetPath(), pLevelInfo->m_defaultGameTypeName.c_str())
|
||||
: gEnv->p3DEngine->LoadLevel(pLevelInfo->GetPath(), pLevelInfo->m_defaultGameTypeName.c_str());
|
||||
if (!is3DEngineLoaded)
|
||||
{
|
||||
OnLoadingError(levelName, "3DEngine failed to handle loading the level");
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Parse level specific config data.
|
||||
AZStd::string const sLevelNameOnly(PathUtil::GetFileName(levelName));
|
||||
|
||||
@@ -760,14 +744,6 @@ ILevel* CLevelSystem::LoadLevelInternal(const char* _levelName)
|
||||
|
||||
gEnv->pSystem->SetSystemGlobalState(ESYSTEM_GLOBAL_STATE_LEVEL_LOAD_START_PRECACHE);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Notify 3D engine that loading finished
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
if (gEnv->p3DEngine)
|
||||
{
|
||||
gEnv->p3DEngine->PostLoadLevel();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
gEnv->pConsole->SetScrollMax(600 / 2);
|
||||
@@ -991,18 +967,6 @@ void CLevelSystem::UnloadLevel()
|
||||
|
||||
CTimeValue tBegin = gEnv->pTimer->GetAsyncTime();
|
||||
|
||||
I3DEngine* p3DEngine = gEnv->p3DEngine;
|
||||
if (p3DEngine)
|
||||
{
|
||||
IDeferredPhysicsEventManager* pPhysEventManager = p3DEngine->GetDeferredPhysicsEventManager();
|
||||
if (pPhysEventManager)
|
||||
{
|
||||
// clear deferred physics queues before renderer, since we could have jobs running
|
||||
// which access a rendermesh
|
||||
pPhysEventManager->ClearDeferredEvents();
|
||||
}
|
||||
}
|
||||
|
||||
//AM: Flush render thread (Flush is not exposed - using EndFrame())
|
||||
//We are about to delete resources that could be in use
|
||||
if (gEnv->pRenderer)
|
||||
@@ -1076,25 +1040,10 @@ void CLevelSystem::UnloadLevel()
|
||||
|
||||
SAFE_RELEASE(m_pCurrentLevel);
|
||||
|
||||
/*
|
||||
Force Lua garbage collection before p3DEngine->UnloadLevel() and pRenderer->FreeResources(flags) are called.
|
||||
p3DEngine->UnloadLevel() will destroy particle emitters even if they're still referenced by Lua objects that are yet to be collected.
|
||||
(as per comment in 3dEngineLoad.cpp (line 501) - "Force to clean all particles that are left, even if still referenced.").
|
||||
Then, during the next GC cycle, Lua finally cleans up, the particle emitter smart pointers will be pointing to invalid memory).
|
||||
Normally the GC step is triggered at the end of this method (by the ESYSTEM_EVENT_LEVEL_POST_UNLOAD event), which is too late
|
||||
(after the render resources have been purged).
|
||||
This extra GC step takes a few ms more level unload time, which is a small price for fixing nasty crashes.
|
||||
If, however, we wanted to claim it back, we could potentially get rid of the GC step that is triggered by ESYSTEM_EVENT_LEVEL_POST_UNLOAD to break even.
|
||||
*/
|
||||
|
||||
// Force Lua garbage collection (may no longer be needed now the legacy renderer has been removed).
|
||||
// Normally the GC step is triggered at the end of this method (by the ESYSTEM_EVENT_LEVEL_POST_UNLOAD event).
|
||||
EBUS_EVENT(AZ::ScriptSystemRequestBus, GarbageCollect);
|
||||
|
||||
// Delete engine resources
|
||||
if (p3DEngine)
|
||||
{
|
||||
p3DEngine->UnloadLevel();
|
||||
|
||||
}
|
||||
// Force to clean render resources left after deleting all objects and materials.
|
||||
IRenderer* pRenderer = gEnv->pRenderer;
|
||||
if (pRenderer)
|
||||
|
||||
Reference in New Issue
Block a user