Missing change for c01614b8f5 and regression from 88eca13eb3
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
#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"
|
||||
#include "Engine/Content/SceneReference.h"
|
||||
@@ -13,7 +15,6 @@
|
||||
API_CLASS(sealed, Namespace="FlaxEditor.Content.Settings") class FLAXENGINE_API BuildSettings : public SettingsBase
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_MINIMAL(BuildSettings);
|
||||
API_AUTO_SERIALIZATION();
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
@@ -99,4 +100,21 @@ 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);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -405,14 +405,14 @@ namespace Serialization
|
||||
|
||||
// ISerializable
|
||||
|
||||
inline bool ShouldSerialize(ISerializable& v, const void* otherObj)
|
||||
inline bool ShouldSerialize(const ISerializable& v, const void* otherObj)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
inline void Serialize(ISerializable::SerializeStream& stream, ISerializable& v, const void* otherObj)
|
||||
inline void Serialize(ISerializable::SerializeStream& stream, const ISerializable& v, const void* otherObj)
|
||||
{
|
||||
stream.StartObject();
|
||||
v.Serialize(stream, otherObj);
|
||||
const_cast<ISerializable*>(&v)->Serialize(stream, otherObj);
|
||||
stream.EndObject();
|
||||
}
|
||||
inline void Deserialize(ISerializable::DeserializeStream& stream, ISerializable& v, ISerializeModifier* modifier)
|
||||
@@ -421,15 +421,15 @@ namespace Serialization
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline typename TEnableIf<TIsBaseOf<ISerializable, T>::Value, bool>::Type ShouldSerialize(ISerializable& v, const void* otherObj)
|
||||
inline typename TEnableIf<TIsBaseOf<ISerializable, T>::Value, bool>::Type ShouldSerialize(const ISerializable& v, const void* otherObj)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
template<typename T>
|
||||
inline typename TEnableIf<TIsBaseOf<ISerializable, T>::Value>::Type Serialize(ISerializable::SerializeStream& stream, ISerializable& v, const void* otherObj)
|
||||
inline typename TEnableIf<TIsBaseOf<ISerializable, T>::Value>::Type Serialize(ISerializable::SerializeStream& stream, const ISerializable& v, const void* otherObj)
|
||||
{
|
||||
stream.StartObject();
|
||||
v.Serialize(stream, otherObj);
|
||||
const_cast<ISerializable*>(&v)->Serialize(stream, otherObj);
|
||||
stream.EndObject();
|
||||
}
|
||||
template<typename T>
|
||||
@@ -441,12 +441,12 @@ namespace Serialization
|
||||
// Scripting Object
|
||||
|
||||
template<typename T>
|
||||
inline typename TEnableIf<TIsBaseOf<ScriptingObject, T>::Value, bool>::Type ShouldSerialize(T*& v, const void* otherObj)
|
||||
inline typename TEnableIf<TIsBaseOf<ScriptingObject, T>::Value, bool>::Type ShouldSerialize(const T*& v, const void* otherObj)
|
||||
{
|
||||
return !otherObj || v != *(T**)otherObj;
|
||||
}
|
||||
template<typename T>
|
||||
inline typename TEnableIf<TIsBaseOf<ScriptingObject, T>::Value>::Type Serialize(ISerializable::SerializeStream& stream, T*& v, const void* otherObj)
|
||||
inline typename TEnableIf<TIsBaseOf<ScriptingObject, T>::Value>::Type Serialize(ISerializable::SerializeStream& stream, const T*& v, const void* otherObj)
|
||||
{
|
||||
stream.Guid(v ? v->GetID() : Guid::Empty);
|
||||
}
|
||||
@@ -568,12 +568,13 @@ namespace Serialization
|
||||
{
|
||||
if (!otherObj)
|
||||
return true;
|
||||
const auto other = (Array<T, AllocationType>*)otherObj;
|
||||
const auto other = (const Array<T, AllocationType>*)otherObj;
|
||||
if (v.Count() != other->Count())
|
||||
return true;
|
||||
const T* vPtr = v.Get();
|
||||
for (int32 i = 0; i < v.Count(); i++)
|
||||
{
|
||||
if (ShouldSerialize((T&)v[i], (const void*)&other->At(i)))
|
||||
if (ShouldSerialize(vPtr[i], (const void*)&other->At(i)))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -582,8 +583,9 @@ namespace Serialization
|
||||
inline void Serialize(ISerializable::SerializeStream& stream, const Array<T, AllocationType>& v, const void* otherObj)
|
||||
{
|
||||
stream.StartArray();
|
||||
const T* vPtr = v.Get();
|
||||
for (int32 i = 0; i < v.Count(); i++)
|
||||
Serialize(stream, (T&)v[i], nullptr);
|
||||
Serialize(stream, vPtr[i], nullptr);
|
||||
stream.EndArray();
|
||||
}
|
||||
template<typename T, typename AllocationType = HeapAllocation>
|
||||
@@ -593,8 +595,9 @@ namespace Serialization
|
||||
{
|
||||
const auto& streamArray = stream.GetArray();
|
||||
v.Resize(streamArray.Size());
|
||||
T* vPtr = v.Get();
|
||||
for (int32 i = 0; i < v.Count(); i++)
|
||||
Deserialize(streamArray[i], v[i], modifier);
|
||||
Deserialize(streamArray[i], vPtr[i], modifier);
|
||||
}
|
||||
else if (TIsPODType<T>::Value && stream.IsString())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user