Files
UnrealEngineUWP/Engine/Source/Developer/Windows/WindowsTargetPlatform/Private/WindowsTargetPlatformModule.cpp
josh adams 3d282bf6e7 - Added early check before creating a TargetPlatform object if the PlatformInfo will be found (check a static function to see if it's usable before making it)
- Changed each platform's GetTargetPlatform[s] function
#rb none
#jira UE-78692
[FYI] bob.tellez


#ROBOMERGE-SOURCE: CL 7952099 via CL 7954770
#ROBOMERGE-BOT: (v393-7951996)

[CL 7954968 by josh adams in Main branch]
2019-08-12 18:12:07 -04:00

89 lines
2.2 KiB
C++

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#include "CoreMinimal.h"
#include "ISettingsModule.h"
#include "Interfaces/ITargetPlatformModule.h"
#include "GenericWindowsTargetPlatform.h"
#include "Modules/ModuleManager.h"
#include "UObject/Package.h"
#include "UObject/WeakObjectPtr.h"
#define LOCTEXT_NAMESPACE "FWindowsTargetPlatformModule"
/** Holds the target platform singleton. */
static ITargetPlatform* Singleton = nullptr;
/**
* Implements the Windows target platform module.
*/
class FWindowsTargetPlatformModule
: public ITargetPlatformModule
{
public:
/** Destructor. */
~FWindowsTargetPlatformModule( )
{
Singleton = nullptr;
}
public:
// this is an example of a hotfix, declared here for no particular reason. Once we have other examples, it can be deleted.
#if 0
void HotfixTest( void *InPayload, int PayloadSize )
{
check(sizeof(FTestHotFixPayload) == PayloadSize);
FTestHotFixPayload* Payload = (FTestHotFixPayload*)InPayload;
UE_LOG(LogTemp, Log, TEXT("Hotfix Test %s"), *Payload->Message);
Payload->Result = Payload->ValueToReturn;
}
#endif
public:
// ITargetPlatformModule interface
virtual ITargetPlatform* GetTargetPlatform( ) override
{
if (Singleton == nullptr && TGenericWindowsTargetPlatform<true, false, false>::IsUsable())
{
Singleton = new TGenericWindowsTargetPlatform<true, false, false>();
}
return Singleton;
}
public:
// IModuleInterface interface
virtual void StartupModule() override
{
// this is an example of a hotfix, declared here for no particular reason. Once we have other examples, it can be deleted.
#if 0
FCoreDelegates::GetHotfixDelegate(EHotfixDelegates::Test).BindRaw(this, &FWindowsTargetPlatformModule::HotfixTest);
#endif
}
virtual void ShutdownModule() override
{
// this is an example of a hotfix, declared here for no particular reason. Once we have other examples, it can be deleted.
#if 0
FCoreDelegates::GetHotfixDelegate(EHotfixDelegates::Test).Unbind();
#endif
ISettingsModule* SettingsModule = FModuleManager::GetModulePtr<ISettingsModule>("Settings");
}
};
#undef LOCTEXT_NAMESPACE
IMPLEMENT_MODULE(FWindowsTargetPlatformModule, WindowsTargetPlatform);