[development] removed CryLibrary (#5474)
* [redcode_crylibrary] replaced CrySystem loading in launcher and editor with new custom wrapper that uses AZ::DynamicModuleHandle Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com> * [redcode_crylibrary] removed all remaining references to CryLibrary Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com> * [redcode_crylibrary] migrate CrySystem loading to use AZ::DynamicModuleHandle directly instead Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com> * [redcode_crylibrary] clean up of CrySystemModuleHandle and old CrySystem module [un]init functions Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com> * [redcode_crylibrary] added trailing newline to DllMain.cpp in CrySystem Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com>
This commit is contained in:
@@ -49,9 +49,6 @@
|
||||
#include "Include/IObjectManager.h"
|
||||
#include "ActionManager.h"
|
||||
|
||||
// Including this too early will result in a linker error
|
||||
#include <CryCommon/CryLibrary.h>
|
||||
|
||||
// Implementation of System Callback structure.
|
||||
struct SSystemUserCallback
|
||||
: public ISystemUserCallback
|
||||
@@ -242,8 +239,7 @@ private:
|
||||
|
||||
AZ_PUSH_DISABLE_WARNING(4273, "-Wunknown-warning-option")
|
||||
CGameEngine::CGameEngine()
|
||||
: m_gameDll(nullptr)
|
||||
, m_bIgnoreUpdates(false)
|
||||
: m_bIgnoreUpdates(false)
|
||||
, m_ePendingGameMode(ePGM_NotPending)
|
||||
, m_modalWindowDismisser(nullptr)
|
||||
AZ_POP_DISABLE_WARNING
|
||||
@@ -253,7 +249,7 @@ AZ_POP_DISABLE_WARNING
|
||||
m_bInGameMode = false;
|
||||
m_bSimulationMode = false;
|
||||
m_bSyncPlayerPosition = true;
|
||||
m_hSystemHandle = nullptr;
|
||||
m_hSystemHandle.reset(nullptr);
|
||||
m_bJustCreated = false;
|
||||
m_levelName = "Untitled";
|
||||
m_levelExtension = EditorUtils::LevelFile::GetDefaultFileExtension();
|
||||
@@ -268,18 +264,10 @@ AZ_POP_DISABLE_WARNING
|
||||
GetIEditor()->UnregisterNotifyListener(this);
|
||||
m_pISystem->GetIMovieSystem()->SetCallback(nullptr);
|
||||
|
||||
if (m_gameDll)
|
||||
{
|
||||
CryFreeLibrary(m_gameDll);
|
||||
}
|
||||
|
||||
delete m_pISystem;
|
||||
m_pISystem = nullptr;
|
||||
|
||||
if (m_hSystemHandle)
|
||||
{
|
||||
CryFreeLibrary(m_hSystemHandle);
|
||||
}
|
||||
m_hSystemHandle.reset(nullptr);
|
||||
|
||||
delete m_pSystemUserCallback;
|
||||
}
|
||||
@@ -347,18 +335,19 @@ AZ::Outcome<void, AZStd::string> CGameEngine::Init(
|
||||
HWND hwndForInputSystem)
|
||||
{
|
||||
m_pSystemUserCallback = new SSystemUserCallback(logo);
|
||||
m_hSystemHandle = CryLoadLibraryDefName("CrySystem");
|
||||
|
||||
if (!m_hSystemHandle)
|
||||
constexpr const char* crySystemLibraryName = AZ_TRAIT_OS_DYNAMIC_LIBRARY_PREFIX "CrySystem" AZ_TRAIT_OS_DYNAMIC_LIBRARY_EXTENSION;
|
||||
|
||||
m_hSystemHandle = AZ::DynamicModuleHandle::Create(crySystemLibraryName);
|
||||
if (!m_hSystemHandle->Load(true))
|
||||
{
|
||||
auto errorMessage = AZStd::string::format("%s Loading Failed", CryLibraryDefName("CrySystem"));
|
||||
auto errorMessage = AZStd::string::format("%s Loading Failed", crySystemLibraryName);
|
||||
Error(errorMessage.c_str());
|
||||
return AZ::Failure(errorMessage);
|
||||
}
|
||||
|
||||
PFNCREATESYSTEMINTERFACE pfnCreateSystemInterface =
|
||||
(PFNCREATESYSTEMINTERFACE)CryGetProcAddress(m_hSystemHandle, "CreateSystemInterface");
|
||||
|
||||
m_hSystemHandle->GetFunction<PFNCREATESYSTEMINTERFACE>("CreateSystemInterface");
|
||||
|
||||
SSystemInitParams sip;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user