Start of async asset loading

- Refactored content manager and asset loaders
- Asset placeholder
- Error asset
This commit is contained in:
Simon Lübeß
2023-03-18 18:59:30 +01:00
parent 7b6662cbc4
commit 50714976e9
11 changed files with 329 additions and 321 deletions
+5 -8
View File
@@ -8,7 +8,7 @@ using System.IO;
namespace GlitchyEngine.Content;
[BonTarget]
class Asset : RefCounter
abstract class Asset : RefCounter
{
internal AssetHandle _handle = .Invalid;
@@ -22,15 +22,12 @@ class Asset : RefCounter
public StringView Identifier
{
get => _identifier;
set
{
_contentManager?.UpdateAssetIdentifier(this, _identifier, value);
_identifier.Set(value);
// TODO: do we need to tell the content manager, that the name changed?
}
internal set => _identifier.Set(value);
}
/// If true the asset is completely loaded. If false it is only partially loaded (if at all).
public bool Complete { get; internal set; }
// TODO: do we need unmanaged assets? Probably not...
/// Gets the content manager that manages this asset; or null if this asset isn't managed.
public IContentManager ContentManager => _contentManager;