Files
UnrealEngineUWP/Engine/Source/Developer/Windows/WindowsTargetPlatform/Private/WindowsTargetPlatformModule.cpp
Josh Adams ccc1743281 - Big TargetPlatform Module cleanup:
- Removed the function to return a single TP, and wrapped the functionality in a simple single required function (platform just has to add TPs to an array, high level code manages init and cleanup of the array)
  - Stripped unncessary code from all TPs
  - Collapsed the desktop targetplatform modules into 1 per platform
  - Renamed LinuxAArch64NoEditorTargetPlatfortm to LinuxAArch64TargetPlatform to match the other non-editor platforms
  - Deleted AllDesktopPlatform

[CL 13502803 by Josh Adams in ue5-main branch]
2020-05-22 09:57:29 -04:00

91 lines
2.5 KiB
C++

// Copyright 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"
/**
* Implements the Windows target platform module.
*/
class FWindowsTargetPlatformModule
: public ITargetPlatformModule
{
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:
virtual void GetTargetPlatforms(TArray<ITargetPlatform*>& TargetPlatforms) override
{
// Editor TP
if (TGenericWindowsTargetPlatform<true, false, false>::IsUsable())
{
TargetPlatforms.Add(new TGenericWindowsTargetPlatform<true, false, false>());
}
// Server TP
if (TGenericWindowsTargetPlatform<false, true, false>::IsUsable())
{
TargetPlatforms.Add(new TGenericWindowsTargetPlatform<false, true, false>());
}
// NoEditor TP
if (TGenericWindowsTargetPlatform<false, false, false>::IsUsable())
{
TargetPlatforms.Add(new TGenericWindowsTargetPlatform<false, false, false>());
}
// Client TP
if (TGenericWindowsTargetPlatform<false, false, true>::IsUsable())
{
TargetPlatforms.Add(new TGenericWindowsTargetPlatform<false, false, true>());
}
}
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);