Files
UnrealEngineUWP/Engine/Source/Developer/Android/AndroidTargetPlatform/Private/AndroidTargetPlatformModule.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

71 lines
2.0 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "CoreMinimal.h"
#include "Modules/ModuleManager.h"
#include "Android/AndroidPlatformProperties.h"
#include "Interfaces/ITargetPlatformModule.h"
#include "Common/TargetPlatformBase.h"
#include "Interfaces/IAndroidDeviceDetection.h"
#include "Interfaces/IAndroidDeviceDetectionModule.h"
#include "AndroidTargetDevice.h"
#include "AndroidTargetPlatform.h"
#include "IAndroidTargetPlatformModule.h"
#define LOCTEXT_NAMESPACE "FAndroidTargetPlatformModule"
/**
* Module for the Android target platform.
*/
class FAndroidTargetPlatformModule : public IAndroidTargetPlatformModule
{
public:
virtual void GetTargetPlatforms(TArray<ITargetPlatform*>& TargetPlatforms) override
{
if (FAndroidTargetPlatform::IsUsable())
{
for (int32 Type = 0; Type < 2; Type++)
{
bool bIsClient = Type == 1;
SinglePlatforms.Add(new FAndroidTargetPlatform(bIsClient));
SinglePlatforms.Add(new FAndroid_ASTCTargetPlatform(bIsClient));
SinglePlatforms.Add(new FAndroid_DXTTargetPlatform(bIsClient));
SinglePlatforms.Add(new FAndroid_ETC2TargetPlatform(bIsClient));
// thse are used in NotifyMultiSelectedFormatsChanged, so track in another array
MultiPlatforms.Add(new FAndroid_MultiTargetPlatform(bIsClient));
}
// join the single and the multi into one
TargetPlatforms.Append(SinglePlatforms);
TargetPlatforms.Append(MultiPlatforms);
// set up the multi platforms now that we have all the other platforms ready to go
NotifyMultiSelectedFormatsChanged();
}
}
virtual void NotifyMultiSelectedFormatsChanged() override
{
for (FAndroid_MultiTargetPlatform* TP : MultiPlatforms)
{
TP->LoadFormats(SinglePlatforms);
}
// @todo multi needs to be passed this event!
}
private:
/** Holds the specific types of target platforms for NotifyMultiSelectedFormatsChanged */
TArray<FAndroidTargetPlatform*> SinglePlatforms;
TArray<FAndroid_MultiTargetPlatform*> MultiPlatforms;
};
#undef LOCTEXT_NAMESPACE
IMPLEMENT_MODULE( FAndroidTargetPlatformModule, AndroidTargetPlatform);