Integrating latest from github/staging

Integrating up through commit 5e1bdae
This commit is contained in:
alexpete
2021-03-26 14:31:50 -07:00
parent 9c54341af8
commit 36c4e827bd
764 changed files with 11453 additions and 20251 deletions
+7 -15
View File
@@ -16,6 +16,8 @@
#include <AzCore/std/functional.h>
#include <AzCore/IO/Path/Path.h>
#include <AzCore/IO/SystemFile.h>
#include <AzCore/Settings/SettingsRegistryImpl.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/StringFunc/StringFunc.h>
#include <AzCore/Utils/Utils.h>
@@ -170,25 +172,15 @@ namespace AZ
AZStd::string GetEngineRootPath()
{
static const AZStd::string engineFile = AZ_CORRECT_FILESYSTEM_SEPARATOR_STRING "engineroot.txt";
AZStd::string currentPath = GetCurrentExecutablePath();
AZStd::string enginePath = currentPath + engineFile;
if (AZ::IO::SystemFile::Exists(enginePath.c_str()))
if (auto registry = AZ::SettingsRegistry::Get(); registry != nullptr)
{
return currentPath;
return AZ::SettingsRegistryMergeUtils::FindEngineRoot(*registry).String();
}
size_t lastPathSeparator = currentPath.find_last_of(AZ_CORRECT_FILESYSTEM_SEPARATOR);
while (lastPathSeparator != AZStd::string::npos)
else
{
currentPath.erase(lastPathSeparator);
enginePath = currentPath + engineFile;
if (AZ::IO::SystemFile::Exists(enginePath.c_str()))
{
return currentPath;
}
lastPathSeparator = currentPath.find_last_of(AZ_CORRECT_FILESYSTEM_SEPARATOR);
AZ::SettingsRegistryImpl localRegistry;
return AZ::SettingsRegistryMergeUtils::FindEngineRoot(localRegistry).String();
}
return "";
}
AZStd::string ScopedAutoTempDirectory::Resolve(const char* path) const