Fix game settings serialization bug
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "Engine/Core/Config/Settings.h"
|
||||
#include "Engine/Serialization/Serialization.h"
|
||||
|
||||
/// <summary>
|
||||
/// Audio settings container.
|
||||
@@ -11,6 +10,7 @@
|
||||
API_CLASS(sealed, Namespace="FlaxEditor.Content.Settings") class FLAXENGINE_API AudioSettings : public SettingsBase
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_MINIMAL(AudioSettings);
|
||||
API_AUTO_SERIALIZATION();
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
@@ -46,12 +46,4 @@ public:
|
||||
|
||||
// [SettingsBase]
|
||||
void Apply() override;
|
||||
|
||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) final override
|
||||
{
|
||||
DESERIALIZE(DisableAudio);
|
||||
DESERIALIZE(DopplerFactor);
|
||||
DESERIALIZE(MuteOnFocusLoss);
|
||||
DESERIALIZE(EnableHRTF);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "Engine/Core/Config/Settings.h"
|
||||
#include "Engine/Serialization/Serialization.h"
|
||||
#include "Engine/Core/Collections/Array.h"
|
||||
#include "Engine/Content/Asset.h"
|
||||
#include "Engine/Content/AssetReference.h"
|
||||
@@ -15,6 +14,7 @@
|
||||
API_CLASS(sealed, Namespace="FlaxEditor.Content.Settings") class FLAXENGINE_API BuildSettings : public SettingsBase
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_MINIMAL(BuildSettings);
|
||||
API_AUTO_SERIALIZATION();
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
@@ -106,21 +106,4 @@ public:
|
||||
/// Gets the instance of the settings asset (default value if missing). Object returned by this method is always loaded with valid data to use.
|
||||
/// </summary>
|
||||
static BuildSettings* Get();
|
||||
|
||||
// [SettingsBase]
|
||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) final override
|
||||
{
|
||||
DESERIALIZE(MaxAssetsPerPackage);
|
||||
DESERIALIZE(MaxPackageSizeMB);
|
||||
DESERIALIZE(ContentKey);
|
||||
DESERIALIZE(ForDistribution);
|
||||
DESERIALIZE(SkipPackaging);
|
||||
DESERIALIZE(AdditionalAssets);
|
||||
DESERIALIZE(AdditionalAssetFolders);
|
||||
DESERIALIZE(ShadersNoOptimize);
|
||||
DESERIALIZE(ShadersGenerateDebugData);
|
||||
DESERIALIZE(SkipDefaultFonts);
|
||||
DESERIALIZE(SkipDotnetPackaging);
|
||||
DESERIALIZE(SkipUnusedDotnetLibsPackaging);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "Engine/Engine/Globals.h"
|
||||
#include "Engine/Profiler/ProfilerCPU.h"
|
||||
#include "Engine/Streaming/StreamingSettings.h"
|
||||
#include "Engine/Serialization/Serialization.h"
|
||||
#if FLAX_TESTS || USE_EDITOR
|
||||
#include "Engine/Platform/FileSystem.h"
|
||||
#endif
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
/// </summary>
|
||||
API_CLASS(sealed, Namespace="FlaxEditor.Content.Settings") class FLAXENGINE_API GameSettings : public SettingsBase
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_MINIMAL(GameSettings);
|
||||
public:
|
||||
DECLARE_SCRIPTING_TYPE_MINIMAL(GameSettings);
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
/// The product full name.
|
||||
/// </summary>
|
||||
@@ -59,7 +59,6 @@ public:
|
||||
Dictionary<String, Guid> CustomSettings;
|
||||
|
||||
public:
|
||||
|
||||
// Settings containers
|
||||
Guid Time;
|
||||
Guid Audio;
|
||||
@@ -87,7 +86,6 @@ public:
|
||||
Guid iOSPlatform;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Gets the instance of the game settings asset (null if missing). Object returned by this method is always loaded with valid data to use.
|
||||
/// </summary>
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
/// </summary>
|
||||
API_CLASS(sealed, Namespace="FlaxEditor.Content.Settings") class FLAXENGINE_API LayersAndTagsSettings : public SettingsBase
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_MINIMAL(LayersAndTagsSettings);
|
||||
public:
|
||||
DECLARE_SCRIPTING_TYPE_MINIMAL(LayersAndTagsSettings);
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
/// The tag names.
|
||||
/// </summary>
|
||||
@@ -25,7 +25,6 @@ public:
|
||||
String Layers[32];
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Gets the instance of the settings asset (default value if missing). Object returned by this method is always loaded with valid data to use.
|
||||
/// </summary>
|
||||
|
||||
@@ -9,9 +9,10 @@
|
||||
/// </summary>
|
||||
API_CLASS(sealed, Namespace="FlaxEditor.Content.Settings") class FLAXENGINE_API TimeSettings : public SettingsBase
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_MINIMAL(TimeSettings);
|
||||
public:
|
||||
DECLARE_SCRIPTING_TYPE_MINIMAL(TimeSettings);
|
||||
API_AUTO_SERIALIZATION();
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
/// The target amount of the game logic updates per second (script updates frequency).
|
||||
/// </summary>
|
||||
@@ -43,7 +44,6 @@ public:
|
||||
float MaxUpdateDeltaTime = 0.1f;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Gets the instance of the settings asset (default value if missing). Object returned by this method is always loaded with valid data to use.
|
||||
/// </summary>
|
||||
@@ -51,5 +51,4 @@ public:
|
||||
|
||||
// [SettingsBase]
|
||||
void Apply() override;
|
||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) final override;
|
||||
};
|
||||
|
||||
@@ -54,15 +54,6 @@ void TimeSettings::Apply()
|
||||
::MaxUpdateDeltaTime = MaxUpdateDeltaTime;
|
||||
}
|
||||
|
||||
void TimeSettings::Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)
|
||||
{
|
||||
DESERIALIZE(UpdateFPS);
|
||||
DESERIALIZE(PhysicsFPS);
|
||||
DESERIALIZE(DrawFPS);
|
||||
DESERIALIZE(TimeScale);
|
||||
DESERIALIZE(MaxUpdateDeltaTime);
|
||||
}
|
||||
|
||||
void Time::TickData::OnBeforeRun(float targetFps, double currentTime)
|
||||
{
|
||||
Time = UnscaledTime = TimeSpan::Zero();
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
API_CLASS(sealed, Namespace="FlaxEditor.Content.Settings") class FLAXENGINE_API InputSettings : public SettingsBase
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_MINIMAL(InputSettings);
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
/// Maps a discrete button or key press events to a "friendly name" that will later be bound to event-driven behavior. The end effect is that pressing (and/or releasing) a key, mouse button, or keypad button.
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
API_CLASS(sealed, Namespace="FlaxEditor.Content.Settings") class FLAXENGINE_API LocalizationSettings : public SettingsBase
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_MINIMAL(LocalizationSettings);
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
/// The list of the string localization tables used by the game.
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
API_CLASS(sealed, Namespace="FlaxEditor.Content.Settings", NoConstructor) class FLAXENGINE_API NavigationSettings : public SettingsBase
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_MINIMAL(NavigationSettings);
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
/// If checked, enables automatic navmesh actors spawning on a scenes that are using it during navigation building.
|
||||
|
||||
@@ -10,8 +10,9 @@
|
||||
/// </summary>
|
||||
API_CLASS(sealed, Namespace="FlaxEditor.Content.Settings") class FLAXENGINE_API NetworkSettings : public SettingsBase
|
||||
{
|
||||
API_AUTO_SERIALIZATION();
|
||||
DECLARE_SCRIPTING_TYPE_MINIMAL(NetworkSettings);
|
||||
API_AUTO_SERIALIZATION();
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
/// Maximum amount of active network clients in a game session. Used by server or host to limit amount of players and spectators.
|
||||
|
||||
@@ -56,6 +56,7 @@ API_ENUM() enum class PhysicsSolverType
|
||||
API_CLASS(sealed, Namespace="FlaxEditor.Content.Settings", NoConstructor) class FLAXENGINE_API PhysicsSettings : public SettingsBase
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_MINIMAL(PhysicsSettings);
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
/// The default gravity force value (in cm^2/s).
|
||||
|
||||
Reference in New Issue
Block a user