Skip to content

Commit

Permalink
Removed Serializer, Switched to Prowl.Echo Nuget Package
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsakharov committed Nov 25, 2024
1 parent 15a1ff6 commit 5656735
Show file tree
Hide file tree
Showing 96 changed files with 222 additions and 2,884 deletions.
4 changes: 3 additions & 1 deletion Prowl.Editor/Assets/AssetDatabase.Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

using Prowl.Runtime;
using Prowl.Runtime.Utils;
using Prowl.Echo;
using Prowl.Echo.FileFormats;

using Debug = Prowl.Runtime.Debug;

Expand Down Expand Up @@ -576,7 +578,7 @@ public static void SaveAsset(EngineObject assetInstance, bool pingAsset = true)
{
try
{
SerializedProperty serialized = Serializer.Serialize(assetInstance);
EchoObject serialized = Serializer.Serialize(assetInstance);
StringTagConverter.WriteToFile(serialized, fileInfo);

if(pingAsset)
Expand Down
4 changes: 3 additions & 1 deletion Prowl.Editor/Assets/Importers/MaterialImporter.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// This file is part of the Prowl Game Engine
// Licensed under the MIT License. See the LICENSE file in the project root for details.

using Prowl.Echo;
using Prowl.Echo.FileFormats;
using Prowl.Editor.Preferences;
using Prowl.Editor.ScriptedEditors;
using Prowl.Runtime;
Expand Down Expand Up @@ -41,7 +43,7 @@ public class MaterialImporterEditor : ScriptedEditor

public override void OnEnable()
{
SerializedProperty tag = StringTagConverter.ReadFromFile((target as MetaFile).AssetPath);
EchoObject tag = StringTagConverter.ReadFromFile((target as MetaFile).AssetPath);
_editingMaterial = Serializer.Deserialize<Material>(tag);

_editor = CreateEditor(_editingMaterial);
Expand Down
2 changes: 2 additions & 0 deletions Prowl.Editor/Assets/Importers/MeshImporter.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// This file is part of the Prowl Game Engine
// Licensed under the MIT License. See the LICENSE file in the project root for details.

using Prowl.Echo;
using Prowl.Echo.FileFormats;
using Prowl.Runtime;
using Prowl.Runtime.Utils;

Expand Down
2 changes: 2 additions & 0 deletions Prowl.Editor/Assets/Importers/PrefabImporter.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// This file is part of the Prowl Game Engine
// Licensed under the MIT License. See the LICENSE file in the project root for details.

using Prowl.Echo;
using Prowl.Echo.FileFormats;
using Prowl.Runtime;
using Prowl.Runtime.Utils;

Expand Down
2 changes: 2 additions & 0 deletions Prowl.Editor/Assets/Importers/SceneImporter.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// This file is part of the Prowl Game Engine
// Licensed under the MIT License. See the LICENSE file in the project root for details.

using Prowl.Echo;
using Prowl.Echo.FileFormats;
using Prowl.Runtime;
using Prowl.Runtime.Utils;

Expand Down
4 changes: 3 additions & 1 deletion Prowl.Editor/Assets/Importers/ScriptableObjectImporter.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// This file is part of the Prowl Game Engine
// Licensed under the MIT License. See the LICENSE file in the project root for details.

using Prowl.Echo;
using Prowl.Echo.FileFormats;
using Prowl.Editor.Preferences;
using Prowl.Editor.ScriptedEditors;
using Prowl.Runtime;
Expand Down Expand Up @@ -28,7 +30,7 @@ public class ScriptableObjectImporterEditor : ScriptedEditor

public override void OnEnable()
{
SerializedProperty tag = StringTagConverter.ReadFromFile((target as MetaFile).AssetPath);
EchoObject tag = StringTagConverter.ReadFromFile((target as MetaFile).AssetPath);
_editingObject = Serializer.Deserialize<ScriptableObject>(tag);
_objectEditor = null; // Replace this to load a Scripta
}
Expand Down
6 changes: 4 additions & 2 deletions Prowl.Editor/Assets/MetaFile.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// This file is part of the Prowl Game Engine
// Licensed under the MIT License. See the LICENSE file in the project root for details.

using Prowl.Echo;
using Prowl.Echo.FileFormats;
using Prowl.Runtime;

namespace Prowl.Editor.Assets;
Expand Down Expand Up @@ -43,7 +45,7 @@ public void Save()
{
FileInfo file = new(AssetPath.FullName + ".meta");
version = MetaVersion;
SerializedProperty tag = Serializer.Serialize(this);
EchoObject tag = Serializer.Serialize(this);
StringTagConverter.WriteToFile(tag, file);
}

Expand All @@ -54,7 +56,7 @@ public void Save()
{
FileInfo file = new(assetFile + ".meta");
if (!File.Exists(file.FullName)) return null; // Doesnt Exist
SerializedProperty tag = StringTagConverter.ReadFromFile(file);
EchoObject tag = StringTagConverter.ReadFromFile(file);
MetaFile? meta = Serializer.Deserialize<MetaFile>(tag);
meta!.AssetPath = assetFile;
meta.lastModified = DateTime.UtcNow;
Expand Down
3 changes: 2 additions & 1 deletion Prowl.Editor/Build/DesktopPlayerBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Prowl.Runtime;
using Prowl.Runtime.Utils;
using Prowl.Runtime.Rendering;
using Prowl.Echo;

namespace Prowl.Editor.Build;

Expand Down Expand Up @@ -260,7 +261,7 @@ private static void PackScenes(AssetRef<Scene>[] scenes, string dataPath)
{
// Debug.Log($"Packing scene_{i}.prowl.");
AssetRef<Scene> scene = scenes[i];
SerializedProperty tag = Serializer.Serialize(scene.Res!);
EchoObject tag = Serializer.Serialize(scene.Res!);
BinaryTagConverter.WriteToFile(tag, new FileInfo(Path.Combine(dataPath, $"scene_{i}.prowl")));
}
}
Expand Down
2 changes: 2 additions & 0 deletions Prowl.Editor/Editor/AssetsBrowserWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

using System.Reflection;

using Prowl.Echo;
using Prowl.Echo.FileFormats;
using Prowl.Editor.Assets;
using Prowl.Editor.Preferences;
using Prowl.Editor.Utilities;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using Prowl.Runtime;
using Prowl.Runtime.Utils;
using Prowl.Echo;

namespace Prowl.Editor.ProjectSettings;

Expand Down
2 changes: 2 additions & 0 deletions Prowl.Editor/EditorGuiManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
using System.ComponentModel.DataAnnotations;
using System.Reflection;

using Prowl.Echo;
using Prowl.Echo.FileFormats;
using Prowl.Editor.Assets;
using Prowl.Editor.Docking;
using Prowl.Editor.Preferences;
Expand Down
2 changes: 2 additions & 0 deletions Prowl.Editor/Utilities/CreateAssetMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

using System.Reflection;

using Prowl.Echo;
using Prowl.Echo.FileFormats;
using Prowl.Editor.Assets;
using Prowl.Runtime;
using Prowl.Runtime.Utils;
Expand Down
1 change: 1 addition & 0 deletions Prowl.Editor/Utilities/ProjectCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using Prowl.Runtime;
using Prowl.Runtime.Utils;
using Prowl.Echo;

namespace Prowl.Editor;

Expand Down
1 change: 1 addition & 0 deletions Prowl.Players/Prowl.Desktop/DesktopPlayer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Prowl.Runtime;
using Prowl.Runtime.SceneManagement;
using Prowl.Echo;

namespace Prowl.Desktop;

Expand Down
1 change: 1 addition & 0 deletions Prowl.Runtime.Test/Boolean32MatrixTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Text;
using System.Threading.Tasks;

using Prowl.Echo;
using Prowl.Runtime.Utils;

using Xunit;
Expand Down
Loading

0 comments on commit 5656735

Please sign in to comment.