Handles barely work now, mostly no crashes

This commit is contained in:
Simon Lübeß
2023-03-16 17:57:23 +01:00
parent c3fb9bbd5d
commit b22f73a156
20 changed files with 780 additions and 627 deletions
+4 -7
View File
@@ -10,7 +10,7 @@ namespace GlitchyEngine.Content;
[BonTarget]
class Asset : RefCounter
{
internal AssetHandle _handle;
internal AssetHandle _handle = .Invalid;
private append String _identifier;
@@ -60,16 +60,13 @@ class Asset : RefCounter
static Result<void> AssetDeserialize(BonReader reader, ValueView value, BonEnvironment environment, DeserializeValueState state)
{
// TODO!!!
return .Err;
/*Log.EngineLogger.Assert(value.type == typeof(Asset));
Log.EngineLogger.Assert(value.type == typeof(Asset));
String identifier = scope .();
Deserialize.String!(reader, ref identifier, environment);
Asset asset = Application.Get().ContentManager.LoadAsset(identifier);
Asset asset = Content.GetAsset<Asset>(Content.LoadAsset(identifier));
if (asset != null)
{
@@ -82,7 +79,7 @@ class Asset : RefCounter
else
{
Deserialize.Error!("Invalid resource path", reader, value.type);
}*/
}
}
//gBonEnv.typeHandlers.Add(typeof(Resource<>),