SPEC-7531 Change Code/CryEngine to Code/Legacy (#1634)

* git mv Code\CryEngine Code\Legacy
* redirecting CMakeLists.txt
* fixing uic warning
* Some more CryEngine mentions
* validation scripts

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-06-29 13:51:24 -07:00
committed by GitHub
parent f570925c0d
commit 9f0bbf3b74
384 changed files with 25 additions and 31 deletions
+46
View File
@@ -0,0 +1,46 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include <CryCommon/CryLibrary.h>
#if !defined(AZ_RESTRICTED_PLATFORM) && defined(WIN32)
HMODULE CryLoadLibrary(const char* libName)
{
HMODULE module = ::LoadLibraryA(libName);
if (module != NULL)
{
// We need to inject the environment first thing so that allocators are available immediately
InjectEnvironmentFunction injectEnv = reinterpret_cast<InjectEnvironmentFunction>(::GetProcAddress(module, INJECT_ENVIRONMENT_FUNCTION));
if (injectEnv)
{
auto env = AZ::Environment::GetInstance();
injectEnv(env);
}
}
return module;
}
// Cry code seems to have used void* as their abstraction for HMODULE across
// platforms.
bool CryFreeLibrary(void* lib)
{
if (lib != NULL)
{
DetachEnvironmentFunction detachEnv = reinterpret_cast<DetachEnvironmentFunction>(::GetProcAddress((HMODULE)lib, DETACH_ENVIRONMENT_FUNCTION));
if (detachEnv)
{
detachEnv();
}
return ::FreeLibrary((HMODULE)lib) != FALSE;
}
return false;
}
#endif