Refactor native Stream serialization to new API

This commit is contained in:
Wojciech Figat
2022-10-20 17:28:12 +02:00
parent e5866a3ff4
commit 32e052a87b
34 changed files with 371 additions and 370 deletions

View File

@@ -135,7 +135,7 @@ namespace Flax.Build.Plugins
if (IsRawPOD(buildData, typeInfo))
{
// POD types as raw bytes
OnGenerateCppWriteRaw(contents, "&obj", serialize);
OnGenerateCppWriteRaw(contents, "obj", serialize);
}
else
{
@@ -188,7 +188,7 @@ namespace Flax.Build.Plugins
throw new Exception($"Invalid pointer type '{type}' that cannot be serialized for replication of {caller.Name}.");
if (type.IsRef)
throw new Exception($"Invalid reference type '{type}' that cannot be serialized for replication of {caller.Name}.");
OnGenerateCppWriteRaw(contents, "&" + name, serialize);
OnGenerateCppWriteRaw(contents, name, serialize);
}
else if (apiType.IsScriptingObject)
{
@@ -196,13 +196,13 @@ namespace Flax.Build.Plugins
if (serialize)
{
contents.AppendLine($" {{Guid id = {name} ? {name}->GetID() : Guid::Empty;");
OnGenerateCppWriteRaw(contents, "&id", serialize);
OnGenerateCppWriteRaw(contents, "id", serialize);
contents.AppendLine(" }");
}
else
{
contents.AppendLine($" {{Guid id;");
OnGenerateCppWriteRaw(contents, "&id", serialize);
OnGenerateCppWriteRaw(contents, "id", serialize);
contents.AppendLine($" {name} = Scripting::TryFindObject(id);}}");
}
}