From 98776a709eff1749ce37865eaff78de63b71d8fc Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Mon, 30 Aug 2021 16:14:52 +0200 Subject: [PATCH] Refactor GDK platform settings and tools, expose more options MicrosoftGame.config --- .../Content/Create/SettingsCreateEntry.cs | 9 + .../Cooker/Platform/GDK/GDKPlatformTools.cpp | 288 ++++++++++++++++++ .../Cooker/Platform/GDK/GDKPlatformTools.h | 36 +++ Source/Editor/Editor.Build.cs | 10 +- Source/Engine/Core/Config/GameSettings.cs | 2 + Source/Engine/Core/Types/String.h | 9 + .../Engine/Platform/GDK/GDKPlatformSettings.h | 130 ++++++++ Source/Engine/Platform/Platform.Build.cs | 1 + 8 files changed, 480 insertions(+), 5 deletions(-) create mode 100644 Source/Editor/Cooker/Platform/GDK/GDKPlatformTools.cpp create mode 100644 Source/Editor/Cooker/Platform/GDK/GDKPlatformTools.h create mode 100644 Source/Engine/Platform/GDK/GDKPlatformSettings.h diff --git a/Source/Editor/Content/Create/SettingsCreateEntry.cs b/Source/Editor/Content/Create/SettingsCreateEntry.cs index 570903baa..bf7f54d23 100644 --- a/Source/Editor/Content/Create/SettingsCreateEntry.cs +++ b/Source/Editor/Content/Create/SettingsCreateEntry.cs @@ -31,9 +31,12 @@ namespace FlaxEditor.Content.Create InputSettings, StreamingSettings, WindowsPlatformSettings, + [EditorDisplay(null, "UWP Platform Settings")] UWPPlatformSettings, LinuxPlatformSettings, + [EditorDisplay(null, "PS4 Platform Settings")] PS4PlatformSettings, + XboxOnePlatformSettings, XboxScarlettPlatformSettings, AndroidPlatformSettings, SwitchPlatformSettings, @@ -56,6 +59,7 @@ namespace FlaxEditor.Content.Create typeof(UWPPlatformSettings), typeof(LinuxPlatformSettings), TypeUtils.GetManagedType(GameSettings.PS4PlatformSettingsTypename), + TypeUtils.GetManagedType(GameSettings.XboxOnePlatformSettingsTypename), TypeUtils.GetManagedType(GameSettings.XboxScarlettPlatformSettingsTypename), typeof(AndroidPlatformSettings), TypeUtils.GetManagedType(GameSettings.SwitchPlatformSettingsTypename), @@ -204,6 +208,11 @@ namespace FlaxEditor.Content.Create return false; instance.PS4Platform = asset; break; + case SettingsTypes.XboxOnePlatformSettings: + if (instance.XboxOnePlatform != null) + return false; + instance.XboxOnePlatform = asset; + break; case SettingsTypes.XboxScarlettPlatformSettings: if (instance.XboxScarlettPlatform != null) return false; diff --git a/Source/Editor/Cooker/Platform/GDK/GDKPlatformTools.cpp b/Source/Editor/Cooker/Platform/GDK/GDKPlatformTools.cpp new file mode 100644 index 000000000..cba41bf82 --- /dev/null +++ b/Source/Editor/Cooker/Platform/GDK/GDKPlatformTools.cpp @@ -0,0 +1,288 @@ +// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved. + +#if PLATFORM_TOOLS_GDK + +#include "GDKPlatformTools.h" +#include "Engine/Platform/File.h" +#include "Engine/Platform/FileSystem.h" +#include "Engine/Platform/GDK/GDKPlatformSettings.h" +#include "Engine/Core/Types/StringBuilder.h" +#include "Engine/Core/Collections/Sorting.h" +#include "Engine/Core/Config/GameSettings.h" +#include "Engine/Graphics/PixelFormat.h" +#include "Editor/Editor.h" +#include "Editor/ProjectInfo.h" +#include "Editor/Utilities/EditorUtilities.h" + +GDKPlatformTools::GDKPlatformTools() +{ + // Find GDK + Platform::GetEnvironmentVariable(TEXT("GameDKLatest"), _gdkPath); + if (_gdkPath.IsEmpty() || !FileSystem::DirectoryExists(_gdkPath)) + { + _gdkPath.Clear(); + Platform::GetEnvironmentVariable(TEXT("GRDKLatest"), _gdkPath); + if (_gdkPath.IsEmpty() || !FileSystem::DirectoryExists(_gdkPath)) + { + _gdkPath.Clear(); + } + else + { + if (_gdkPath.EndsWith(TEXT("GRDK\\"))) + _gdkPath.Remove(_gdkPath.Length() - 6); + else if (_gdkPath.EndsWith(TEXT("GRDK"))) + _gdkPath.Remove(_gdkPath.Length() - 5); + } + } +} + +bool GDKPlatformTools::UseAOT() const +{ + return true; +} + +bool GDKPlatformTools::OnScriptsStepDone(CookingData& data) +{ + // Override Newtonsoft.Json.dll for some platforms (that don't support runtime code generation) + const String customBinPath = data.GetPlatformBinariesRoot() / TEXT("Newtonsoft.Json.dll"); + const String assembliesPath = data.ManagedCodeOutputPath; + if (FileSystem::CopyFile(assembliesPath / TEXT("Newtonsoft.Json.dll"), customBinPath)) + { + data.Error(TEXT("Failed to copy deloy custom assembly.")); + return true; + } + FileSystem::DeleteFile(assembliesPath / TEXT("Newtonsoft.Json.pdb")); + + return false; +} + +bool GDKPlatformTools::OnDeployBinaries(CookingData& data) +{ + // Copy binaries + const Char* executableFilename = TEXT("FlaxGame.exe"); + const auto binPath = data.GetGameBinariesPath(); + FileSystem::CreateDirectory(data.NativeCodeOutputPath); + Array files; + files.Add(binPath / executableFilename); + if (!FileSystem::FileExists(files[0])) + { + data.Error(TEXT("Missing executable file ({0})."), files[0]); + return true; + } + FileSystem::DirectoryGetFiles(files, binPath, TEXT("*.dll"), DirectorySearchOption::TopDirectoryOnly); + for (int32 i = 0; i < files.Count(); i++) + { + if (FileSystem::CopyFile(data.NativeCodeOutputPath / StringUtils::GetFileName(files[i]), files[i])) + { + data.Error(TEXT("Failed to setup output directory (file {0})."), files[i]); + return true; + } + } + + return false; +} + +void GDKPlatformTools::OnConfigureAOT(CookingData& data, AotConfig& config) +{ + const auto platformDataPath = data.GetPlatformBinariesRoot(); + const bool useInterpreter = true; // TODO: use Full AOT on GDK + const bool enableDebug = data.Configuration != BuildConfiguration::Release; + const Char* aotMode = useInterpreter ? TEXT("full,interp") : TEXT("full"); + const Char* debugMode = enableDebug ? TEXT("soft-debug") : TEXT("nodebug"); + config.AotCompilerArgs = String::Format(TEXT("--aot={0},verbose,stats,print-skipped,{1} -O=all"), aotMode, debugMode); + if (enableDebug) + config.AotCompilerArgs = TEXT("--debug ") + config.AotCompilerArgs; + config.AotCompilerPath = platformDataPath / TEXT("Tools/mono.exe"); +} + +bool GDKPlatformTools::OnPerformAOT(CookingData& data, AotConfig& config, const String& assemblyPath) +{ + // Skip .dll.dll which could be a false result from the previous AOT which could fail + if (assemblyPath.EndsWith(TEXT(".dll.dll"))) + { + LOG(Warning, "Skip AOT for file '{0}' as it can be a result from the previous task", assemblyPath); + return false; + } + + // Check if skip this assembly (could be already processed) + const String filename = StringUtils::GetFileName(assemblyPath); + const String outputPath = config.AotCachePath / filename + TEXT(".dll"); + if (FileSystem::FileExists(outputPath) && FileSystem::GetFileLastEditTime(assemblyPath) < FileSystem::GetFileLastEditTime(outputPath)) + return false; + LOG(Info, "Calling AOT tool for \"{0}\"", assemblyPath); + + // Cleanup temporary results (fromm the previous AT that fail or sth) + const String resultPath = assemblyPath + TEXT(".dll"); + const String resultPathExp = resultPath + TEXT(".exp"); + const String resultPathLib = resultPath + TEXT(".lib"); + const String resultPathPdb = resultPath + TEXT(".pdb"); + if (FileSystem::FileExists(resultPath)) + FileSystem::DeleteFile(resultPath); + if (FileSystem::FileExists(resultPathExp)) + FileSystem::DeleteFile(resultPathExp); + if (FileSystem::FileExists(resultPathLib)) + FileSystem::DeleteFile(resultPathLib); + if (FileSystem::FileExists(resultPathPdb)) + FileSystem::DeleteFile(resultPathPdb); + + // Call tool + const String workingDir = StringUtils::GetDirectoryName(config.AotCompilerPath); + const String command = String::Format(TEXT("\"{0}\" {1} \"{2}\""), config.AotCompilerPath, config.AotCompilerArgs, assemblyPath); + const int32 result = Platform::RunProcess(command, workingDir, config.EnvVars); + if (result != 0) + { + data.Error(TEXT("AOT tool execution failed with result code {1} for assembly \"{0}\". See log for more info."), assemblyPath, result); + return true; + } + + // Copy result + if (FileSystem::CopyFile(outputPath, resultPath)) + { + data.Error(TEXT("Failed to copy the AOT tool result file. It can be missing.")); + return true; + } + + // Copy pdb file if exists + if (data.Configuration != BuildConfiguration::Release && FileSystem::FileExists(resultPathPdb)) + { + FileSystem::CopyFile(config.AotCachePath / StringUtils::GetFileName(resultPathPdb), resultPathPdb); + } + + // Clean intermediate results + if (FileSystem::DeleteFile(resultPath) + || (FileSystem::FileExists(resultPathExp) && FileSystem::DeleteFile(resultPathExp)) + || (FileSystem::FileExists(resultPathLib) && FileSystem::DeleteFile(resultPathLib)) + || (FileSystem::FileExists(resultPathPdb) && FileSystem::DeleteFile(resultPathPdb)) + ) + { + LOG(Warning, "Failed to remove the AOT tool result file(s)."); + } + + return false; +} + +bool GDKPlatformTools::OnPostProcess(CookingData& data, GDKPlatformSettings* platformSettings) +{ + // Configuration + const auto gameSettings = GameSettings::Get(); + const auto project = Editor::Project; + const Char* executableFilename = TEXT("FlaxGame.exe"); + const String name = gameSettings->ProductName; + const String assetsFolder = data.DataOutputPath / TEXT("Assets"); + if (!FileSystem::DirectoryExists(assetsFolder)) + FileSystem::CreateDirectory(assetsFolder); + + // Generate application icons + data.StepProgress(TEXT("Deploying icons"), 0); + if (EditorUtilities::ExportApplicationImage(platformSettings->Square150x150Logo, 150, 150, PixelFormat::B8G8R8A8_UNorm, assetsFolder / TEXT("Square150x150Logo.png"))) + return true; + if (EditorUtilities::ExportApplicationImage(platformSettings->Square480x480Logo, 480, 480, PixelFormat::B8G8R8A8_UNorm, assetsFolder / TEXT("Square480x480Logo.png"))) + return true; + if (EditorUtilities::ExportApplicationImage(platformSettings->Square44x44Logo, 44, 44, PixelFormat::B8G8R8A8_UNorm, assetsFolder / TEXT("Square44x44Logo.png"))) + return true; + if (EditorUtilities::ExportApplicationImage(platformSettings->StoreLogo, 100, 100, PixelFormat::B8G8R8A8_UNorm, assetsFolder / TEXT("StoreLogo.png"))) + return true; + if (EditorUtilities::ExportApplicationImage(platformSettings->SplashScreenImage, 1920, 1080, PixelFormat::B8G8R8X8_UNorm, assetsFolder / TEXT("SplashScreenImage.png"), EditorUtilities::ApplicationImageType::SplashScreen)) + return true; + + // Generate MicrosoftGame.config file + data.StepProgress(TEXT("Generating package meta"), 0.2f); + const String configFilePath = data.DataOutputPath / TEXT("MicrosoftGame.config"); + LOG(Info, "Generating config file to \"{0}\"", configFilePath); + { + StringBuilder sb; + Array validName; + for (int32 i = 0; i < name.Length() && validName.Count() <= 50; i++) + { + auto c = name[i]; + switch (c) + { + case '.': + case '[': + case ']': + case '+': + case '-': + case '_': + validName.Add(c); + break; + default: + if (StringUtils::IsAlnum(c)) + validName.Add(c); + } + } + validName.Add('\0'); + + sb.Append(TEXT("\n")); + sb.Append(TEXT("\n")); + sb.AppendFormat(TEXT(" \n"), + validName.Get(), + platformSettings->PublisherName.HasChars() ? platformSettings->PublisherName : TEXT("CN=") + gameSettings->CompanyName, + project->Version.ToString(4)); + sb.Append(TEXT(" \n")); + sb.AppendFormat(TEXT(" ")); + sb.Append(TEXT(" \n")); + sb.AppendFormat(TEXT(" ProductName); + sb.AppendFormat(TEXT(" PublisherDisplayName=\"{0}\"\n"), platformSettings->PublisherDisplayName.HasChars() ? platformSettings->PublisherDisplayName : gameSettings->CompanyName); + sb.AppendFormat(TEXT(" BackgroundColor=\"#{0}\"\n"), platformSettings->BackgroundColor.ToHexString()); + sb.AppendFormat(TEXT(" ForegroundText=\"{0}\"\n"), platformSettings->ForegroundText); + sb.Append(TEXT(" Square150x150Logo=\"Assets\\Square150x150Logo.png\"\n")); + sb.Append(TEXT(" Square480x480Logo=\"Assets\\Square480x480Logo.png\"\n")); + sb.Append(TEXT(" Square44x44Logo=\"Assets\\Square44x44Logo.png\"\n")); + sb.Append(TEXT(" StoreLogo=\"Assets\\StoreLogo.png\"\n")); + sb.Append(TEXT(" SplashScreenImage=\"Assets\\SplashScreenImage.png\"\n")); + sb.Append(TEXT(" />\n")); + if (platformSettings->TitleId.HasChars()) + sb.AppendFormat(TEXT(" {0}\n"), platformSettings->TitleId); + if (platformSettings->StoreId.HasChars()) + sb.AppendFormat(TEXT(" {0}\n"), platformSettings->StoreId); + sb.AppendFormat(TEXT(" {0}\n"), platformSettings->RequiresXboxLive); + sb.Append(TEXT(" \n")); + sb.AppendFormat(TEXT(" {0}\n"), platformSettings->GameDVRSystemComponent); + sb.AppendFormat(TEXT(" {0}\n"), platformSettings->BlockBroadcast); + sb.AppendFormat(TEXT(" {0}\n"), platformSettings->BlockGameDVR); + sb.Append(TEXT(" \n")); + sb.Append(TEXT("\n")); + + if (File::WriteAllText(configFilePath, sb, Encoding::ANSI)) + { + LOG(Error, "Failed to create config file."); + return true; + } + } + + // Remove previous package file + const String packageOutputPath = data.DataOutputPath / TEXT("Package"); + if (FileSystem::DirectoryExists(packageOutputPath)) + FileSystem::DeleteDirectory(packageOutputPath); + + // Generate package layout + data.StepProgress(TEXT("Generating package layout"), 0.3f); + const String gdkBinPath = _gdkPath / TEXT("../bin"); + const String makePkgPath = gdkBinPath / TEXT("MakePkg.exe"); + const String command = String::Format(TEXT("\"{0}\" genmap /f layout.xml /d \"{1}\""), makePkgPath, data.DataOutputPath); + const int32 result = Platform::RunProcess(command, data.DataOutputPath); + if (result != 0) + { + data.Error(TEXT("Failed to generate package layout.")); + return true; + } + + return false; +} + +#endif diff --git a/Source/Editor/Cooker/Platform/GDK/GDKPlatformTools.h b/Source/Editor/Cooker/Platform/GDK/GDKPlatformTools.h new file mode 100644 index 000000000..5617b6a6b --- /dev/null +++ b/Source/Editor/Cooker/Platform/GDK/GDKPlatformTools.h @@ -0,0 +1,36 @@ +// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved. + +#pragma once + +#if PLATFORM_TOOLS_GDK + +#include "Editor/Cooker/PlatformTools.h" + +class GDKPlatformSettings; + +/// +/// The GDK platform support tools. +/// +class GDKPlatformTools : public PlatformTools +{ +protected: + + String _gdkPath; + +public: + + GDKPlatformTools(); + + bool OnPostProcess(CookingData& data, GDKPlatformSettings* platformSettings); + +public: + + // [PlatformTools] + bool UseAOT() const override; + bool OnScriptsStepDone(CookingData& data) override; + bool OnDeployBinaries(CookingData& data) override; + void OnConfigureAOT(CookingData& data, AotConfig& config) override; + bool OnPerformAOT(CookingData& data, AotConfig& config, const String& assemblyPath) override; +}; + +#endif diff --git a/Source/Editor/Editor.Build.cs b/Source/Editor/Editor.Build.cs index 693652538..f595d6449 100644 --- a/Source/Editor/Editor.Build.cs +++ b/Source/Editor/Editor.Build.cs @@ -11,12 +11,12 @@ using Microsoft.Win32; /// public class Editor : EditorModule { - private void AddPlatformTools(BuildOptions options, string platformToolsRoot, string platformToolsRootExternal, string platform, string macro) + private void AddPlatformTools(BuildOptions options, string platformToolsRoot, string platformToolsRootExternal, string platform, params string[] macros) { if (Directory.Exists(Path.Combine(platformToolsRoot, platform))) { // Platform Tools bundled inside Editor module - options.PrivateDefinitions.Add(macro); + options.PrivateDefinitions.AddRange(macros); } else { @@ -24,7 +24,7 @@ public class Editor : EditorModule if (Directory.Exists(externalPath)) { // Platform Tools inside external platform implementation location - options.PrivateDefinitions.Add(macro); + options.PrivateDefinitions.AddRange(macros); options.SourcePaths.Add(externalPath); AddSourceFileIfExists(options, Path.Combine(Globals.EngineRoot, "Source", "Platforms", platform, "Engine", "Platform", platform + "PlatformSettings.cs")); } @@ -55,9 +55,9 @@ public class Editor : EditorModule { AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "Windows", "PLATFORM_TOOLS_WINDOWS"); AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "UWP", "PLATFORM_TOOLS_UWP"); - AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "XboxOne", "PLATFORM_TOOLS_XBOX_ONE"); + AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "XboxOne", "PLATFORM_TOOLS_XBOX_ONE", "PLATFORM_TOOLS_GDK"); AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "PS4", "PLATFORM_TOOLS_PS4"); - AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "XboxScarlett", "PLATFORM_TOOLS_XBOX_SCARLETT"); + AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "XboxScarlett", "PLATFORM_TOOLS_XBOX_SCARLETT", "PLATFORM_TOOLS_GDK"); AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "Android", "PLATFORM_TOOLS_ANDROID"); AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "Switch", "PLATFORM_TOOLS_SWITCH"); } diff --git a/Source/Engine/Core/Config/GameSettings.cs b/Source/Engine/Core/Config/GameSettings.cs index 1ab84c2d6..36d93ff3b 100644 --- a/Source/Engine/Core/Config/GameSettings.cs +++ b/Source/Engine/Core/Config/GameSettings.cs @@ -366,6 +366,8 @@ namespace FlaxEditor.Content.Settings return SaveAsset(gameSettings, ref gameSettings.LinuxPlatform, obj); if (type.FullName == PS4PlatformSettingsTypename) return SaveAsset(gameSettings, ref gameSettings.PS4Platform, obj); + if (type.FullName == XboxOnePlatformSettingsTypename) + return SaveAsset(gameSettings, ref gameSettings.XboxOnePlatform, obj); if (type.FullName == XboxScarlettPlatformSettingsTypename) return SaveAsset(gameSettings, ref gameSettings.XboxScarlettPlatform, obj); if (type == typeof(AndroidPlatformSettings)) diff --git a/Source/Engine/Core/Types/String.h b/Source/Engine/Core/Types/String.h index 3485a1093..542d2f9b3 100644 --- a/Source/Engine/Core/Types/String.h +++ b/Source/Engine/Core/Types/String.h @@ -1022,6 +1022,15 @@ public: /// The string to insert. void Insert(int32 startIndex, const String& other); + /// + /// Removes characters from the string at given location until the end. + /// + /// The index of the first character to remove. + void Remove(int32 startIndex) + { + Remove(startIndex, _length - startIndex); + } + /// /// Removes characters from the string at given location and length. /// diff --git a/Source/Engine/Platform/GDK/GDKPlatformSettings.h b/Source/Engine/Platform/GDK/GDKPlatformSettings.h new file mode 100644 index 000000000..f64925f58 --- /dev/null +++ b/Source/Engine/Platform/GDK/GDKPlatformSettings.h @@ -0,0 +1,130 @@ +// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved. + +#pragma once + +#if PLATFORM_GDK || USE_EDITOR + +#include "Engine/Core/Config/PlatformSettingsBase.h" +#include "Engine/Core/Math/Color.h" + +/// +/// GDK platform settings. +/// +API_CLASS(Namespace="FlaxEditor.Content.Settings") class FLAXENGINE_API GDKPlatformSettings : public SettingsBase +{ +DECLARE_SCRIPTING_TYPE_MINIMAL(GDKPlatformSettings); +public: + + /// + /// Game publisher identity name stored in game package manifest (for store). + /// + API_FIELD(Attributes="EditorOrder(100), EditorDisplay(\"General\")") + String PublisherName; + + /// + /// Game publisher display name stored in game package manifest (for UI). + /// + API_FIELD(Attributes="EditorOrder(110), EditorDisplay(\"General\")") + String PublisherDisplayName; + + /// + /// Application small logo texture of size 150x150 px (asset id). + /// + API_FIELD(Attributes="EditorOrder(200), CustomEditorAlias(\"FlaxEditor.CustomEditors.Editors.AssetRefEditor\"), AssetReference(typeof(Texture)), EditorDisplay(\"Visuals\")") + Guid Square150x150Logo; + + /// + /// Application large logo texture of size 480x480 px (asset id). + /// + API_FIELD(Attributes="EditorOrder(205), CustomEditorAlias(\"FlaxEditor.CustomEditors.Editors.AssetRefEditor\"), AssetReference(typeof(Texture)), EditorDisplay(\"Visuals\")") + Guid Square480x480Logo; + + /// + /// Application small logo texture of size 44x44 px (asset id). + /// + API_FIELD(Attributes="EditorOrder(210), CustomEditorAlias(\"FlaxEditor.CustomEditors.Editors.AssetRefEditor\"), AssetReference(typeof(Texture)), EditorDisplay(\"Visuals\")") + Guid Square44x44Logo; + + /// + /// Application splash screen texture (asset id). + /// + API_FIELD(Attributes="EditorOrder(220), CustomEditorAlias(\"FlaxEditor.CustomEditors.Editors.AssetRefEditor\"), AssetReference(typeof(Texture)), EditorDisplay(\"Visuals\")") + Guid SplashScreenImage; + + /// + /// Application store logo texture (asset id). + /// + API_FIELD(Attributes="EditorOrder(230), CustomEditorAlias(\"FlaxEditor.CustomEditors.Editors.AssetRefEditor\"), AssetReference(typeof(Texture)), EditorDisplay(\"Visuals\")") + Guid StoreLogo; + + /// + /// Application background color. + /// + API_FIELD(Attributes="EditorOrder(240), DefaultValue(typeof(Color), \"0,0,0,1\"), EditorDisplay(\"Visuals\")") + Color BackgroundColor = Color::Black; + + /// + /// Application foreground text theme (light or dark). + /// + API_FIELD(Attributes="EditorOrder(250), EditorDisplay(\"Visuals\")") + String ForegroundText = TEXT("light"); + + /// + /// Specifies the Titles Xbox Live Title ID, used for identity with Xbox Live services (optional). + /// + API_FIELD(Attributes="EditorOrder(300), EditorDisplay(\"Xbox Live\")") + String TitleId; + + /// + /// Specifies the Titles Xbox Live Title ID, used for identity with Xbox Live services (optional). + /// + API_FIELD(Attributes="EditorOrder(310), EditorDisplay(\"Xbox Live\")") + String StoreId; + + /// + /// Specifies if the title requires Xbox Live connectivity in order to run (optional). + /// + API_FIELD(Attributes="EditorOrder(320), EditorDisplay(\"Xbox Live\")") + bool RequiresXboxLive = false; + + /// + /// Specifies if the Game DVR system component is enabled or not. + /// + API_FIELD(Attributes="EditorOrder(400), EditorDisplay(\"Media Capture\")") + bool GameDVRSystemComponent = true; + + /// + /// Specifies if broadcasting the title should be blocked or allowed. + /// + API_FIELD(Attributes="EditorOrder(410), EditorDisplay(\"Media Capture\")") + bool BlockBroadcast = false; + + /// + /// Specifies if Game DVR of the title should be blocked or allowed. + /// + API_FIELD(Attributes="EditorOrder(420), EditorDisplay(\"Media Capture\")") + bool BlockGameDVR = false; + +public: + + // [SettingsBase] + void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override + { + DESERIALIZE(PublisherName); + DESERIALIZE(PublisherDisplayName); + DESERIALIZE(Square150x150Logo); + DESERIALIZE(Square480x480Logo); + DESERIALIZE(Square44x44Logo); + DESERIALIZE(SplashScreenImage); + DESERIALIZE(StoreLogo); + DESERIALIZE(BackgroundColor); + DESERIALIZE(TitleId); + DESERIALIZE(StoreId); + DESERIALIZE(RequiresXboxLive); + DESERIALIZE(GameDVRSystemComponent); + DESERIALIZE(BlockBroadcast); + DESERIALIZE(BlockGameDVR); + } +}; + +#endif diff --git a/Source/Engine/Platform/Platform.Build.cs b/Source/Engine/Platform/Platform.Build.cs index 68c284acd..b97af0817 100644 --- a/Source/Engine/Platform/Platform.Build.cs +++ b/Source/Engine/Platform/Platform.Build.cs @@ -82,6 +82,7 @@ public class Platform : EngineModule options.SourceFiles.Add(Path.Combine(FolderPath, "UWP", "UWPPlatformSettings.h")); options.SourceFiles.Add(Path.Combine(FolderPath, "Linux", "LinuxPlatformSettings.h")); options.SourceFiles.Add(Path.Combine(FolderPath, "Android", "AndroidPlatformSettings.h")); + options.SourceFiles.Add(Path.Combine(FolderPath, "GDK", "GDKPlatformSettings.h")); AddSourceFileIfExists(options, Path.Combine(Globals.EngineRoot, "Source", "Platforms", "XboxOne", "Engine", "Platform", "XboxOnePlatformSettings.h")); AddSourceFileIfExists(options, Path.Combine(Globals.EngineRoot, "Source", "Platforms", "XboxScarlett", "Engine", "Platform", "XboxScarlettPlatformSettings.h")); AddSourceFileIfExists(options, Path.Combine(Globals.EngineRoot, "Source", "Platforms", "PS4", "Engine", "Platform", "PS4PlatformSettings.h"));