2019-12-26 15:32:37 -05:00
// Copyright Epic Games, Inc. All Rights Reserved.
2014-06-05 12:13:44 -04:00
# pragma once
2016-11-23 15:48:37 -05:00
# include "CoreMinimal.h"
2020-07-01 17:07:12 -04:00
# include "Misc/DataDrivenPlatformInfoRegistry.h"
# if DDPI_HAS_EXTENDED_PLATFORMINFO_DATA
2016-11-23 15:48:37 -05:00
2014-06-05 12:13:44 -04:00
namespace PlatformInfo
{
2020-07-01 17:07:12 -04:00
/** Flags describing platform variants */
namespace EPlatformFlags
2014-06-05 12:13:44 -04:00
{
2020-07-01 17:07:12 -04:00
typedef uint8 Flags ;
enum Flag
{
/** Nothing of interest */
None = 0 ,
2014-06-05 12:13:44 -04:00
2020-07-01 17:07:12 -04:00
/** The flavor generates different output when building (eg, 32 or 64-bit) */
BuildFlavor = 1 < < 0 ,
2014-06-05 12:13:44 -04:00
2020-07-01 17:07:12 -04:00
/** The flavor generates different output when cooking (eg, ETC2 or ASTC texture format) */
CookFlavor = 1 < < 1 ,
} ;
}
2014-06-05 12:13:44 -04:00
/** Flavor types used when filtering the platforms based upon their flags */
enum class EPlatformFilter : uint8
{
/** Include all platform types */
All ,
/** Include only build flavors */
BuildFlavor ,
/** Include only cook flavors */
CookFlavor ,
} ;
/** Information about a given platform */
2020-07-01 17:07:12 -04:00
struct FTargetPlatformInfo
2014-06-05 12:13:44 -04:00
{
2020-07-29 16:19:10 -04:00
DESKTOPPLATFORM_API FTargetPlatformInfo ( const FString & InIniPlatformName , EBuildTargetType InType , const FString & InCookFlavor ) ;
2014-06-05 12:13:44 -04:00
2020-07-29 16:19:10 -04:00
/** Name of the Info object as well as the ITargetPlatform that this Info describes */
FName Name ;
2014-06-05 12:13:44 -04:00
2020-03-02 11:26:01 -05:00
/** Platform flavor, eg "ETC2" for "Android_ETC2" */
2014-06-05 12:13:44 -04:00
FName PlatformFlavor ;
/** The friendly (and localized) display name of this platform */
FText DisplayName ;
/** Type of this platform */
2019-08-09 16:46:25 -04:00
EBuildTargetType PlatformType ;
2014-06-05 12:13:44 -04:00
/** Flags for this platform */
EPlatformFlags : : Flags PlatformFlags ;
/** Additional argument string data to append to UAT commands relating to this platform */
FString UATCommandLine ;
2020-07-01 17:07:12 -04:00
/** Name of this platform when loading INI files (and finding DataDrivenPlatformInfo) */
FName IniPlatformName ;
2014-07-23 17:11:42 -04:00
2020-07-01 17:07:12 -04:00
/** For flavors, this points to the vanilla (parent) object - for vanilla objects, this points to itself so ->VanillaInfo can be used without checking for null */
FTargetPlatformInfo * VanillaInfo ;
2014-07-31 13:31:22 -04:00
2020-07-01 17:07:12 -04:00
/** For vanilla objects, this contains the flavors (children) */
TArray < const FTargetPlatformInfo * > Flavors ;
2014-07-31 13:31:22 -04:00
2020-07-01 17:07:12 -04:00
/** Cached pointer to the DDPI */
const FDataDrivenPlatformInfo * DataDrivenPlatformInfo ;
2019-10-16 11:33:20 -04:00
2014-06-05 12:13:44 -04:00
/** Returns true if this platform is vanilla */
FORCEINLINE bool IsVanilla ( ) const
{
return PlatformFlavor . IsNone ( ) ;
}
/** Returns true if this platform is a flavor */
FORCEINLINE bool IsFlavor ( ) const
{
return ! PlatformFlavor . IsNone ( ) ;
}
2020-07-01 17:07:12 -04:00
// convenience function
2014-06-05 12:13:44 -04:00
FName GetIconStyleName ( const EPlatformIconSize InIconSize ) const
{
2020-07-01 17:07:12 -04:00
return DataDrivenPlatformInfo - > GetIconStyleName ( InIconSize ) ;
2014-06-05 12:13:44 -04:00
}
} ;
/**
* Try and find the information for the given platform
* @param InPlatformName - The name of the platform to find
* @return The platform info if the platform was found, null otherwise
*/
2020-07-01 17:07:12 -04:00
DESKTOPPLATFORM_API const FTargetPlatformInfo * FindPlatformInfo ( const FName & InPlatformName ) ;
2014-06-05 12:13:44 -04:00
/**
* Try and find the vanilla information for the given platform
* @param InPlatformName - The name of the platform to find (can be a flavor, but you'll still get back the vanilla platform)
* @return The platform info if the platform was found, null otherwise
*/
2020-07-01 17:07:12 -04:00
DESKTOPPLATFORM_API const FTargetPlatformInfo * FindVanillaPlatformInfo ( const FName & InPlatformName ) ;
2014-06-05 12:13:44 -04:00
/**
* Get an array of all the platforms we know about
* @return The pointer to the start of the platform array
*/
2020-07-01 17:07:12 -04:00
DESKTOPPLATFORM_API const TArray < FTargetPlatformInfo * > & GetPlatformInfoArray ( ) ;
2014-06-05 12:13:44 -04:00
/**
2020-07-01 17:07:12 -04:00
* Get an array of only the vanilla platforms
2014-07-31 13:31:22 -04:00
* @return The pointer to the start of the platform array
*/
2020-07-01 17:07:12 -04:00
DESKTOPPLATFORM_API const TArray < FTargetPlatformInfo * > & GetVanillaPlatformInfoArray ( ) ;
2014-07-31 13:31:22 -04:00
2015-09-21 01:23:29 -04:00
/**
* Update the display name for a platform
* @param InPlatformName - The platform to update
* @param InDisplayName - The new display name
*/
DESKTOPPLATFORM_API void UpdatePlatformDisplayName ( FString InPlatformName , FText InDisplayName ) ;
2016-04-14 20:35:31 -04:00
2018-02-22 11:25:06 -05:00
/**
* Returns a list of all defined Platform Groups, excluding None.
* Used to to present a list in the Per-Platform Properties UI.
2018-11-19 10:12:17 -05:00
* @return An array of FNames.
2018-02-22 11:25:06 -05:00
*/
DESKTOPPLATFORM_API const TArray < FName > & GetAllPlatformGroupNames ( ) ;
2018-11-19 10:12:17 -05:00
/**
* Returns a list of all defined Platform, in vanilla form.
* Used to to present a list in the Per-Platform Properties UI.
* @return An array of FNames.
*/
DESKTOPPLATFORM_API const TArray < FName > & GetAllVanillaPlatformNames ( ) ;
2020-09-01 14:07:48 -04:00
/**
* Returns a map of all preview platform shader format names to their menu items
* Used to generate the editor preview platform menu
* @return the map of shader format names to the menu items
*/
2021-04-08 14:32:07 -04:00
DESKTOPPLATFORM_API const TArray < FPreviewPlatformMenuItem > & GetPreviewPlatformMenuItems ( ) ;
2014-06-05 12:13:44 -04:00
}
2020-07-01 17:07:12 -04:00
# endif