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:
bosnichd
2021-05-05 09:07:28 -06:00
committed by GitHub
parent 24df655d8b
commit d7b796fd73
222 changed files with 124 additions and 26474 deletions
-185
View File
@@ -34,15 +34,11 @@
// Editor
#include "IEditorImpl.h"
#include "CryEditDoc.h"
#include "Geometry/EdMesh.h"
#include "Mission.h"
#include "Settings.h"
// CryCommon
#include <CryCommon/I3DEngine.h>
#include <CryCommon/INavigationSystem.h>
#include <CryCommon/IDeferredCollisionEvent.h>
#include <CryCommon/ITimeOfDay.h>
#include <CryCommon/LyShine/ILyShine.h>
#include <CryCommon/MainThreadRenderRequestBus.h>
@@ -283,7 +279,6 @@ AZ_POP_DISABLE_WARNING
AZ::Interface<IEditorCameraController>::Unregister(this);
GetIEditor()->UnregisterNotifyListener(this);
m_pISystem->GetIMovieSystem()->SetCallback(NULL);
CEdMesh::ReleaseAll();
if (m_gameDll)
{
@@ -493,13 +488,6 @@ AZ::Outcome<void, AZStd::string> CGameEngine::Init(
SetEditorCoreEnvironment(gEnv);
if (gEnv
&& gEnv->p3DEngine
&& gEnv->p3DEngine->GetTimeOfDay())
{
gEnv->p3DEngine->GetTimeOfDay()->BeginEditMode();
}
if (gEnv && gEnv->pMovieSystem)
{
gEnv->pMovieSystem->EnablePhysicsEvents(m_bSimulationMode);
@@ -549,11 +537,6 @@ void CGameEngine::SetLevelPath(const QString& path)
{
m_levelExtension = defaultExtension;
}
if (gEnv->p3DEngine)
{
gEnv->p3DEngine->SetLevelPath(m_levelPath.toUtf8().data());
}
}
void CGameEngine::SetMissionName(const QString& mission)
@@ -607,24 +590,11 @@ bool CGameEngine::LoadLevel(
}
// Load level in 3d engine.
if (gEnv->p3DEngine && !gEnv->p3DEngine->InitLevelForEditor(m_levelPath.toUtf8().data(), m_missionName.toUtf8().data()))
{
CLogFile::WriteLine("ERROR: Can't load level !");
QMessageBox::critical(QApplication::activeWindow(), QString(), QObject::tr("ERROR: Can't load level !"));
return false;
}
// Audio: notify audio of level loading start?
GetIEditor()->GetObjectManager()->SendEvent(EVENT_REFRESH);
m_bLevelLoaded = true;
if (!bReleaseResources)
{
ReloadEnvironment();
}
return true;
}
@@ -638,61 +608,8 @@ bool CGameEngine::ReloadLevel()
return true;
}
bool CGameEngine::LoadMission(const QString& mission)
{
if (!IsLevelLoaded())
{
return false;
}
if (mission != m_missionName)
{
m_missionName = mission;
gEnv->p3DEngine->LoadMissionDataFromXMLNode(m_missionName.toUtf8().data());
}
return true;
}
bool CGameEngine::ReloadEnvironment()
{
if (!gEnv->p3DEngine)
{
return false;
}
if (!IsLevelLoaded() && !m_bJustCreated)
{
return false;
}
if (!GetIEditor()->GetDocument())
{
return false;
}
XmlNodeRef env = XmlHelpers::CreateXmlNode("Environment");
CXmlTemplate::SetValues(GetIEditor()->GetDocument()->GetEnvironmentTemplate(), env);
// Notify mission that environment may be changed.
GetIEditor()->GetDocument()->GetCurrentMission()->OnEnvironmentChange();
QString xmlStr = QString::fromLatin1(env->getXML());
// Reload level data in engine.
gEnv->p3DEngine->LoadEnvironmentSettingsFromXML(env);
return true;
}
void CGameEngine::SwitchToInGame()
{
if (gEnv->p3DEngine)
{
gEnv->p3DEngine->DisablePostEffects();
gEnv->p3DEngine->ResetPostEffects();
}
auto streamer = AZ::Interface<AZ::IO::IStreamer>::Get();
if (streamer)
{
@@ -707,11 +624,6 @@ void CGameEngine::SwitchToInGame()
m_pISystem->SetThreadState(ESubsys_Physics, false);
if (gEnv->p3DEngine)
{
gEnv->p3DEngine->ResetParticlesAndDecals();
}
m_pISystem->GetIMovieSystem()->EnablePhysicsEvents(true);
m_bInGameMode = true;
@@ -721,10 +633,6 @@ void CGameEngine::SwitchToInGame()
pRuler->SetActive(false);
}
if (gEnv->p3DEngine)
{
gEnv->p3DEngine->GetTimeOfDay()->EndEditMode();
}
gEnv->pSystem->GetViewCamera().SetMatrix(m_playerViewTM);
// Disable accelerators.
@@ -760,24 +668,9 @@ void CGameEngine::SwitchToInEditor()
m_pISystem->SetThreadState(ESubsys_Physics, false);
if (gEnv->p3DEngine)
{
// Reset 3d engine effects
gEnv->p3DEngine->DisablePostEffects();
gEnv->p3DEngine->ResetPostEffects();
gEnv->p3DEngine->ResetParticlesAndDecals();
}
CViewport* pGameViewport = GetIEditor()->GetViewManager()->GetGameViewport();
m_pISystem->GetIMovieSystem()->EnablePhysicsEvents(m_bSimulationMode);
if (gEnv->p3DEngine)
{
gEnv->p3DEngine->GetTimeOfDay()->BeginEditMode();
// this has to be done before the RemoveSink() call, or else some entities may not be removed
gEnv->p3DEngine->GetDeferredPhysicsEventManager()->ClearDeferredEvents();
}
// Enable accelerators.
GetIEditor()->EnableAcceleratos(true);
@@ -865,7 +758,6 @@ void CGameEngine::SetGameMode(bool bInGame)
// Ignore updates while changing in and out of game mode
m_bIgnoreUpdates = true;
LockResources();
// Switching modes will destroy the current AzFramework::EntityConext which may contain
// data the queued events hold on to, so execute all queued events before switching.
@@ -891,7 +783,6 @@ void CGameEngine::SetGameMode(bool bInGame)
GetISystem()->GetISystemEventDispatcher()->OnSystemEvent(ESYSTEM_EVENT_EDITOR_GAME_MODE_CHANGED, bInGame, 0);
UnlockResources();
m_bIgnoreUpdates = false;
GetISystem()->GetISystemEventDispatcher()->OnSystemEvent(ESYSTEM_EVENT_GAME_MODE_SWITCH_END, bInGame, 0);
@@ -906,11 +797,6 @@ void CGameEngine::SetSimulationMode(bool enabled, bool bOnlyPhysics)
m_pISystem->GetIMovieSystem()->EnablePhysicsEvents(enabled);
if (!bOnlyPhysics)
{
LockResources();
}
if (enabled)
{
CRuler* pRuler = GetIEditor()->GetRuler();
@@ -935,35 +821,12 @@ void CGameEngine::SetSimulationMode(bool enabled, bool bOnlyPhysics)
if (m_bSimulationMode)
{
if (!bOnlyPhysics)
{
if (m_pISystem->GetI3DEngine())
{
m_pISystem->GetI3DEngine()->ResetPostEffects();
}
GetIEditor()->SetConsoleVar("ai_ignoreplayer", 1);
//GetIEditor()->SetConsoleVar( "ai_soundperception",0 );
}
// [Anton] the order of the next 3 calls changed, since, EVENT_INGAME loads physics state (if any),
// and Reset should be called before it
GetIEditor()->GetObjectManager()->SendEvent(EVENT_INGAME);
}
else
{
if (!bOnlyPhysics)
{
GetIEditor()->SetConsoleVar("ai_ignoreplayer", 0);
//GetIEditor()->SetConsoleVar( "ai_soundperception",1 );
if (m_pISystem->GetI3DEngine())
{
m_pISystem->GetI3DEngine()->ResetPostEffects();
}
}
GetIEditor()->GetObjectManager()->SendEvent(EVENT_OUTOFGAME);
}
@@ -983,23 +846,9 @@ void CGameEngine::SetSimulationMode(bool enabled, bool bOnlyPhysics)
AzToolsFramework::EditorEntityContextRequestBus::Broadcast(&AzToolsFramework::EditorEntityContextRequestBus::Events::StartPlayInEditor);
}
if (!bOnlyPhysics)
{
UnlockResources();
}
AzFramework::InputChannelRequestBus::Broadcast(&AzFramework::InputChannelRequests::ResetState);
}
void CGameEngine::ResetResources()
{
if (gEnv->p3DEngine)
{
gEnv->p3DEngine->UnloadLevel();
}
}
void CGameEngine::SetPlayerViewMatrix(const Matrix34& tm, [[maybe_unused]] bool bEyePos)
{
m_playerViewTM = tm;
@@ -1107,24 +956,6 @@ void CGameEngine::OnEditorNotifyEvent(EEditorNotifyEvent event)
{
switch (event)
{
case eNotify_OnBeginNewScene:
case eNotify_OnBeginSceneOpen:
{
ResetResources();
}
break;
case eNotify_OnEndSceneOpen:
case eNotify_OnEndTerrainRebuild:
{
}
case eNotify_OnEndNewScene: // intentional fall-through?
{
if (gEnv->p3DEngine)
{
gEnv->p3DEngine->PostLoadLevel();
}
}
break;
case eNotify_OnSplashScreenDestroyed:
{
if (m_pSystemUserCallback != NULL)
@@ -1136,22 +967,6 @@ void CGameEngine::OnEditorNotifyEvent(EEditorNotifyEvent event)
}
}
void CGameEngine::LockResources()
{
if (gEnv->p3DEngine)
{
gEnv->p3DEngine->LockCGFResources();
}
}
void CGameEngine::UnlockResources()
{
if (gEnv->p3DEngine)
{
gEnv->p3DEngine->UnlockCGFResources();
}
}
void CGameEngine::OnTerrainModified(const Vec2& modPosition, float modAreaRadius, bool fullTerrain)
{
INavigationSystem* pNavigationSystem = nullptr; // INavigationSystem will be converted to an AZInterface (LY-111343)