LYN-2723: Fixes issues with bad project or engine paths (#369)

* Setup NativeUIRequests as an AZ::Interface.  Adds a NativeUISystemComponent to AzFramework Application.

* Renames NativeUISystemComponent (class) to NativeUISystem, since it's no longer a Component.

* Minor update to SettingsRegistryInterface::Remove doc-comments for accuracy.

* Fixes to make an early fatal shutdown of Editor occur without crash.

* LYN-2723: Updates startup to handle errors: engine root is empty, no valid project.json found (mismatched engine name), or bad project path (launch project picker dialog).

* LYN-2723: Minor formatting/spelling edits.

* LYN-2723: Moves ParseCommandLine from ComponentApplication to SettingsRegistryMergeUtils so it can be used in more places.

* Misc fixes. 'wait_for_connect' setting wasn't being properly applied to AP connection settings. Fix infinite loop in CCmdLine::Next.

* LYN-2723: Addresses review feedback.

* LYN-2723: Reverts some changes that caused a unit test to fail.

* LYN-2723: Reverts one more change that was unnecessary.
This commit is contained in:
Eric Phister
2021-04-28 18:54:02 -05:00
committed by phistere
parent ed74bb9166
commit 7dd7e82d86
22 changed files with 281 additions and 225 deletions
+21 -7
View File
@@ -5045,12 +5045,28 @@ extern "C"
#pragma comment(lib, "Shell32.lib")
#endif
struct CryAllocatorsRAII
{
CryAllocatorsRAII()
{
AZ_Assert(!AZ::AllocatorInstance<AZ::LegacyAllocator>::IsReady(), "Expected allocator to not be initialized, hunt down the static that is initializing it");
AZ_Assert(!AZ::AllocatorInstance<CryStringAllocator>::IsReady(), "Expected allocator to not be initialized, hunt down the static that is initializing it");
AZ::AllocatorInstance<AZ::LegacyAllocator>::Create();
AZ::AllocatorInstance<CryStringAllocator>::Create();
}
~CryAllocatorsRAII()
{
AZ::AllocatorInstance<CryStringAllocator>::Destroy();
AZ::AllocatorInstance<AZ::LegacyAllocator>::Destroy();
}
};
extern "C" int AZ_DLL_EXPORT CryEditMain(int argc, char* argv[])
{
AZ_Assert(!AZ::AllocatorInstance<AZ::LegacyAllocator>::IsReady(), "Expected allocator to not be initialized, hunt down the static that is initializing it");
AZ::AllocatorInstance<AZ::LegacyAllocator>::Create();
AZ_Assert(!AZ::AllocatorInstance<CryStringAllocator>::IsReady(), "Expected allocator to not be initialized, hunt down the static that is initializing it");
AZ::AllocatorInstance<CryStringAllocator>::Create();
CryAllocatorsRAII cryAllocatorsRAII;
// ensure the EditorEventsBus context gets created inside EditorLib
[[maybe_unused]] const auto& editorEventsContext = AzToolsFramework::EditorEvents::Bus::GetOrCreateContext();
@@ -5058,7 +5074,7 @@ extern "C" int AZ_DLL_EXPORT CryEditMain(int argc, char* argv[])
// connect relevant buses to global settings
gSettings.Connect();
CCryEditApp* theApp = new CCryEditApp();
auto theApp = AZStd::make_unique<CCryEditApp>();
// this does some magic to set the current directory...
{
QCoreApplication app(argc, argv);
@@ -5145,8 +5161,6 @@ extern "C" int AZ_DLL_EXPORT CryEditMain(int argc, char* argv[])
}
delete theApp;
gSettings.Disconnect();
return ret;