Merge branch 'development' into cmake/SPEC-7182

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

# Conflicts:
#	Code/Editor/QtUtil.h
#	Code/Legacy/CryCommon/Linux_Win32Wrapper.h
#	Code/Legacy/CryCommon/ProjectDefines.h
#	Code/Legacy/CryCommon/StringUtils.h
#	Code/Legacy/CryCommon/UnicodeBinding.h
#	Code/Legacy/CryCommon/UnicodeEncoding.h
#	Code/Legacy/CryCommon/UnicodeFunctions.h
#	Code/Legacy/CryCommon/UnicodeIterator.h
#	Code/Legacy/CryCommon/WinBase.cpp
#	Code/Legacy/CryCommon/platform.h
#	Code/Legacy/CryCommon/platform_impl.cpp
#	Gems/LyShine/Code/Source/Animation/UiAnimationSystem.cpp
#	Gems/Maestro/Code/Source/Cinematics/Movie.cpp
This commit is contained in:
Esteban Papp
2021-08-11 11:16:24 -07:00
463 changed files with 2873 additions and 18373 deletions
+23 -19
View File
@@ -8,16 +8,16 @@
#include <platform.h>
#include <StringUtils.h>
#include <ISystem.h>
#include <Random.h>
#include <UnicodeFunctions.h>
#include <IConsole.h>
#include <AzCore/Debug/Profiler.h>
#include <AzCore/Debug/ProfileModuleInit.h>
#include <AzCore/Memory/AllocatorManager.h>
#include <AzCore/Module/Environment.h>
#include <AzCore/std/string/conversions.h>
#include <AzCore/Utils/Utils.h>
// Section dictionary
#if defined(AZ_RESTRICTED_PLATFORM)
@@ -215,28 +215,28 @@ void CrySleep(unsigned int dwMilliseconds)
int CryMessageBox([[maybe_unused]] const char* lpText, [[maybe_unused]] const char* lpCaption, [[maybe_unused]] unsigned int uType)
{
#ifdef WIN32
#if !defined(RESOURCE_COMPILER)
ICVar* const pCVar = gEnv && gEnv->pConsole ? gEnv->pConsole->GetCVar("sys_no_crash_dialog") : NULL;
if ((pCVar && pCVar->GetIVal() != 0) || (gEnv && gEnv->bNoAssertDialog))
{
return 0;
}
#endif
wstring wideText, wideCaption;
Unicode::Convert(wideText, lpText);
Unicode::Convert(wideCaption, lpCaption);
return MessageBoxW(NULL, wideText.c_str(), wideCaption.c_str(), uType);
AZStd::wstring lpTextW;
AZStd::to_wstring(lpTextW, lpText);
AZStd::wstring lpCaptionW;
AZStd::to_wstring(lpCaptionW, lpCaption);
return MessageBoxW(NULL, lpTextW.c_str(), lpCaptionW.c_str(), uType);
#else
return 0;
#endif
}
// Initializes root folder of the game, optionally returns exe and path name.
void InitRootDir(char szExeFileName[], uint nExeSize, char szExeRootName[], [[maybe_unused]] uint nRootSize)
void InitRootDir(char szExeFileName[], uint nExeSize, char szExeRootName[], uint nRootSize)
{
WCHAR szPath[_MAX_PATH];
size_t nLen = GetModuleFileNameW(GetModuleHandle(NULL), szPath, _MAX_PATH);
assert(nLen < _MAX_PATH && "The path to the current executable exceeds the expected length");
char szPath[_MAX_PATH];
AZ::Utils::GetExecutablePathReturnType ret = AZ::Utils::GetExecutablePath(szPath, _MAX_PATH);
AZ_Assert(ret.m_pathStored == AZ::Utils::ExecutablePathResult::Success, "The path to the current executable exceeds the expected length");
const size_t nLen = strnlen(szPath, _MAX_PATH);
// Find path above exe name and deepest folder.
bool firstIteration = true;
@@ -251,25 +251,27 @@ void InitRootDir(char szExeFileName[], uint nExeSize, char szExeRootName[], [[ma
// Return exe path
if (szExeRootName)
{
Unicode::Convert(szExeRootName, n+1, szPath);
azstrncpy(szExeRootName, nRootSize, szPath + n + 1, nLen - n - 1);
}
// Return exe name
if (szExeFileName)
{
Unicode::Convert(szExeFileName, nExeSize, szPath + n);
azstrncpy(szExeFileName, nExeSize, szPath + n, nLen - n);
}
firstIteration = false;
}
// Check if the engineroot exists
wcscat_s(szPath, L"\\engine.json");
azstrcat(szPath, AZ_ARRAY_SIZE(szPath), "\\engine.json");
WIN32_FILE_ATTRIBUTE_DATA data;
BOOL res = GetFileAttributesExW(szPath, GetFileExInfoStandard, &data);
wchar_t szPathW[_MAX_PATH];
AZStd::to_wstring(szPathW, _MAX_PATH, szPath);
BOOL res = GetFileAttributesExW(szPathW, GetFileExInfoStandard, &data);
if (res != 0 && data.dwFileAttributes != INVALID_FILE_ATTRIBUTES)
{
// Found file
szPath[n] = 0;
SetCurrentDirectoryW(szPath);
SetCurrentDirectoryW(szPathW);
break;
}
}
@@ -391,7 +393,9 @@ bool CrySetFileAttributes(const char* lpFileName, uint32 dwFileAttributes)
#if defined(AZ_RESTRICTED_SECTION_IMPLEMENTED)
#undef AZ_RESTRICTED_SECTION_IMPLEMENTED
#else
return SetFileAttributes(lpFileName, dwFileAttributes) != 0;
AZStd::wstring lpFileNameW;
AZStd::to_wstring(lpFileNameW, lpFileName);
return SetFileAttributes(lpFileNameW.c_str(), dwFileAttributes) != 0;
#endif
}
@@ -440,7 +444,7 @@ inline void CryDebugStr([[maybe_unused]] const char* format, ...)
va_start(ArgList, format);
azvsnprintf(szBuffer,sizeof(szBuffer)-1, format, ArgList);
va_end(ArgList);
cry_strcat(szBuffer,"\n");
azstrcat(szBuffer,"\n");
OutputDebugString(szBuffer);
#endif
*/