mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Basic material serialisation
This commit is contained in:
@@ -46,7 +46,7 @@ class Asset : RefCounter
|
||||
_contentManager?.UnmanageAsset(this);
|
||||
}
|
||||
|
||||
static void AssetSerialize(BonWriter writer, ValueView value, BonEnvironment environment)
|
||||
static void AssetSerialize(BonWriter writer, ValueView value, BonEnvironment environment, SerializeValueState state)
|
||||
{
|
||||
Log.EngineLogger.Assert(value.type == typeof(Asset));
|
||||
|
||||
@@ -54,7 +54,7 @@ class Asset : RefCounter
|
||||
writer.String(identifier);
|
||||
}
|
||||
|
||||
static Result<void> AssetDeserialize(BonReader reader, ValueView value, BonEnvironment environment)//, DeserializeFieldState state)
|
||||
static Result<void> AssetDeserialize(BonReader reader, ValueView value, BonEnvironment environment, DeserializeValueState state)
|
||||
{
|
||||
Log.EngineLogger.Assert(value.type == typeof(Asset));
|
||||
|
||||
|
||||
@@ -36,14 +36,14 @@ namespace GlitchyEngine.Core
|
||||
return (int)_uuid;
|
||||
}
|
||||
|
||||
static void Serialize(BonWriter writer, ValueView val, BonEnvironment env)
|
||||
static void Serialize(BonWriter writer, ValueView val, BonEnvironment env, SerializeValueState state)
|
||||
{
|
||||
UUID uuid = *(UUID*)val.dataPtr;
|
||||
|
||||
Bon.Integrated.Serialize.[Friend]Integer(typeof(uint64), writer, ValueView(typeof(uint64), &uuid._uuid));
|
||||
}
|
||||
|
||||
public static Result<void> Deserialize(BonReader reader, ValueView val, BonEnvironment env)
|
||||
public static Result<void> Deserialize(BonReader reader, ValueView val, BonEnvironment env, DeserializeValueState state)
|
||||
{
|
||||
Bon.Integrated.Deserialize.[Friend]Integer!(typeof(uint64), reader, val);
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace GlitchyEngine.World
|
||||
|
||||
String buffer = scope String();
|
||||
let writer = scope BonWriter(buffer, true);
|
||||
Serialize.Start(writer);
|
||||
var length = Serialize.Start(writer);
|
||||
|
||||
gBonEnv.serializeFlags |= .IncludeDefault | .Verbose;
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace GlitchyEngine.World
|
||||
writer.EntryEnd();
|
||||
}
|
||||
|
||||
Serialize.End(writer);
|
||||
Serialize.End(writer, length);
|
||||
|
||||
String targetDirectory = Path.GetDirectoryPath(filePath, .. scope String());
|
||||
Directory.CreateDirectory(targetDirectory);
|
||||
|
||||
Vendored
+1
-1
Submodule GlitchyEngine/vendor/bon updated: 928cfa14ea...0c80e365cd
Reference in New Issue
Block a user