Add Switch platform

This commit is contained in:
Wojtek Figat
2021-03-09 14:26:30 +01:00
parent 044234a55b
commit cc201e198d
40 changed files with 123 additions and 3 deletions

View File

@@ -55,6 +55,8 @@ IMPLEMENT_SETTINGS_GETTER(PS4PlatformSettings, PS4Platform);
IMPLEMENT_SETTINGS_GETTER(XboxScarlettPlatformSettings, XboxScarlettPlatform);
#elif PLATFORM_ANDROID
IMPLEMENT_SETTINGS_GETTER(AndroidPlatformSettings, AndroidPlatform);
#elif PLATFORM_SWITCH
IMPLEMENT_SETTINGS_GETTER(SwitchPlatformSettings, SwitchPlatform);
#else
#error Unknown platform
#endif
@@ -199,6 +201,7 @@ void GameSettings::Deserialize(DeserializeStream& stream, ISerializeModifier* mo
DESERIALIZE(PS4Platform);
DESERIALIZE(XboxScarlettPlatform);
DESERIALIZE(AndroidPlatform);
DESERIALIZE(SwitchPlatform);
}
void LayersAndTagsSettings::Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)

View File

@@ -11,6 +11,7 @@ namespace FlaxEditor.Content.Settings
{
internal const string PS4PlatformSettingsTypename = "FlaxEditor.Content.Settings.PS4PlatformSettings";
internal const string XboxScarlettPlatformSettingsTypename = "FlaxEditor.Content.Settings.XboxScarlettPlatformSettings";
internal const string SwitchPlatformSettingsTypename = "FlaxEditor.Content.Settings.SwitchPlatformSettings";
/// <summary>
/// The default application icon.
@@ -138,6 +139,14 @@ namespace FlaxEditor.Content.Settings
public JsonAsset AndroidPlatform;
#endif
#if FLAX_EDITOR || PLATFORM_SWITCH
/// <summary>
/// Reference to Switch Platform Settings asset. Used to apply configuration on Switch platform.
/// </summary>
[EditorOrder(2070), EditorDisplay("Platform Settings", "Switch"), AssetReference(SwitchPlatformSettingsTypename, true), Tooltip("Reference to Switch Platform Settings asset")]
public JsonAsset SwitchPlatform;
#endif
/// <summary>
/// Gets the absolute path to the game settings asset file.
/// </summary>
@@ -240,6 +249,10 @@ namespace FlaxEditor.Content.Settings
if (type == typeof(AndroidPlatformSettings))
return LoadAsset<AndroidPlatformSettings>(gameSettings.AndroidPlatform) as T;
#endif
#if FLAX_EDITOR || PLATFORM_SWITCH
if (type.FullName == SwitchPlatformSettingsTypename)
return LoadAsset(gameSettings.SwitchPlatform, SwitchPlatformSettingsTypename) as T;
#endif
if (gameSettings.CustomSettings != null)
{
@@ -324,6 +337,8 @@ namespace FlaxEditor.Content.Settings
return SaveAsset(gameSettings, ref gameSettings.XboxScarlettPlatform, obj);
if (type == typeof(AndroidPlatformSettings))
return SaveAsset(gameSettings, ref gameSettings.AndroidPlatform, obj);
if (type.FullName == SwitchPlatformSettingsTypename)
return SaveAsset(gameSettings, ref gameSettings.SwitchPlatform, obj);
if (type == typeof(AudioSettings))
return SaveAsset(gameSettings, ref gameSettings.Audio, obj);

View File

@@ -77,6 +77,7 @@ public:
Guid PS4Platform;
Guid XboxScarlettPlatform;
Guid AndroidPlatform;
Guid SwitchPlatform;
public:

View File

@@ -23,3 +23,6 @@
#if PLATFORM_ANDROID
#include "Engine/Platform/Android/AndroidPlatformSettings.h"
#endif
#if PLATFORM_SWITCH
#include "Platforms/Switch/Engine/Platform/SwitchPlatformSettings.h"
#endif