You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb trivial #rnx #preflight 626a5913631e64c0b9f23de3 - Some of our local structures, like FPLugin can get confused by the debugger with the version in the engine. Wrapping the tools code in the virtualization namespace helps keep the separation clear and stops the debugger from getting confused. - Plus even though this is an UE program, I probably should've stuck to the new namespace rules anyway. #ushell-cherrypick of 19955706 by paul.chipchase [CL 19956237 by paul chipchase in ue5-main branch]
57 lines
1.6 KiB
C++
57 lines
1.6 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "UnrealVirtualizationTool.h"
|
|
|
|
#include "Modules/ModuleManager.h"
|
|
#include "RequiredProgramMainCPPInclude.h"
|
|
#include "UnrealVirtualizationToolApp.h"
|
|
|
|
IMPLEMENT_APPLICATION(UnrealVirtualizationTool, "UnrealVirtualizationTool");
|
|
|
|
DEFINE_LOG_CATEGORY(LogVirtualizationTool);
|
|
|
|
bool UnrealVirtualizationToolMain(int32 ArgC, TCHAR* ArgV[])
|
|
{
|
|
using namespace UE::Virtualization;
|
|
|
|
GEngineLoop.PreInit(ArgC, ArgV);
|
|
check(GConfig && GConfig->IsReadyForUse());
|
|
|
|
FModuleManager::Get().StartProcessingNewlyLoadedObjects();
|
|
|
|
bool bRanSuccessfully = true;
|
|
|
|
FUnrealVirtualizationToolApp App;
|
|
|
|
EInitResult Result = App.Initialize();
|
|
if (Result == EInitResult::Success)
|
|
{
|
|
if (!App.Run())
|
|
{
|
|
UE_LOG(LogVirtualizationTool, Error, TEXT("UnrealVirtualizationTool ran with errors"));
|
|
bRanSuccessfully = false;
|
|
}
|
|
}
|
|
else if(Result == EInitResult::Error)
|
|
{
|
|
UE_LOG(LogVirtualizationTool, Error, TEXT("UnrealVirtualizationTool failed to initialize"));
|
|
bRanSuccessfully = false;
|
|
}
|
|
|
|
UE_CLOG(bRanSuccessfully, LogVirtualizationTool, Display, TEXT("UnrealVirtualizationTool ran successfully"));
|
|
|
|
// Even though we are exiting anyway we need to request an engine exit in order to get a clean shutdown
|
|
RequestEngineExit(TEXT("The process has finished"));
|
|
|
|
FEngineLoop::AppPreExit();
|
|
FModuleManager::Get().UnloadModulesAtShutdown();
|
|
FEngineLoop::AppExit();
|
|
|
|
return bRanSuccessfully;
|
|
}
|
|
|
|
INT32_MAIN_INT32_ARGC_TCHAR_ARGV()
|
|
{
|
|
FTaskTagScope Scope(ETaskTag::EGameThread);
|
|
return UnrealVirtualizationToolMain(ArgC, ArgV) ? 0 : 1;
|
|
} |