mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Added option to create Materials in Asset Browser
This commit is contained in:
@@ -135,7 +135,7 @@ namespace GlitchyEngine.Content
|
||||
void UnmanageAsset(AssetHandle asset);
|
||||
|
||||
/// Returns a data stream for the given asset.
|
||||
Stream GetStream(StringView assetIdentifier);
|
||||
Stream GetStream(StringView assetIdentifier, bool openOnly = true);
|
||||
|
||||
void RegisterAssetLoader<T>() where T : new, class, IAssetLoader;
|
||||
void SetAsDefaultAssetLoader<T>(params Span<StringView> fileExtensions) where T : IAssetLoader;
|
||||
@@ -143,81 +143,4 @@ namespace GlitchyEngine.Content
|
||||
|
||||
//Stream GetFile(String filename);
|
||||
}
|
||||
|
||||
class RuntimeContentManager : IContentManager
|
||||
{
|
||||
public this()
|
||||
{
|
||||
Runtime.NotImplemented();
|
||||
}
|
||||
|
||||
public AssetHandle LoadAsset(StringView assetIdentifier, bool blocking = false)
|
||||
{
|
||||
Runtime.NotImplemented();
|
||||
}
|
||||
|
||||
public Asset GetAsset(Type assetType, AssetHandle handle)
|
||||
{
|
||||
Runtime.NotImplemented();
|
||||
}
|
||||
|
||||
public AssetHandle ManageAsset(Asset asset)
|
||||
{
|
||||
Runtime.NotImplemented();
|
||||
}
|
||||
|
||||
public void UnmanageAsset(AssetHandle asset)
|
||||
{
|
||||
Runtime.NotImplemented();
|
||||
}
|
||||
|
||||
public Stream GetStream(StringView assetIdentifier)
|
||||
{
|
||||
Runtime.NotImplemented();
|
||||
}
|
||||
|
||||
public void RegisterAssetLoader<T>() where T : IAssetLoader where T : class where T : new
|
||||
{
|
||||
Runtime.NotImplemented();
|
||||
}
|
||||
|
||||
public void SetAsDefaultAssetLoader<T>(params Span<StringView> fileExtensions) where T : IAssetLoader
|
||||
{
|
||||
Runtime.NotImplemented();
|
||||
}
|
||||
/*private String _contentRoot;
|
||||
|
||||
[AllowAppend]
|
||||
public this(String contentRoot)
|
||||
{
|
||||
String cntRoot = append String(contentRoot);
|
||||
_contentRoot = cntRoot;
|
||||
|
||||
Runtime.Assert(Directory.Exists(contentRoot), "Content root directory doesn't exist.");
|
||||
}
|
||||
|
||||
public void GetFilePath(String outFilename, String filename)
|
||||
{
|
||||
Path.InternalCombine(outFilename, _contentRoot, filename);
|
||||
}
|
||||
|
||||
public Stream GetFile(String filename)
|
||||
{
|
||||
String fullpath = scope .(_contentRoot.Length + 1 + filename.Length);
|
||||
GetFilePath(fullpath, filename);
|
||||
|
||||
Log.EngineLogger.AssertDebug(File.Exists(fullpath), "File doesn't exist!");
|
||||
|
||||
FileStream stream = new FileStream();
|
||||
var result = stream.Open(fullpath, .Read, .Read);
|
||||
|
||||
if (result case .Err(let error))
|
||||
{
|
||||
Log.EngineLogger.Error($"Failed to open file \"{fullpath}\". Error: {error}");
|
||||
return null;
|
||||
}
|
||||
|
||||
return stream;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,7 @@ public class Material : Asset
|
||||
textureHandle = .Invalid;
|
||||
}
|
||||
|
||||
_textures[new String(name)] = (textureHandle, effectTexture.TextureDimension);
|
||||
newTextures[new String(name)] = (textureHandle, effectTexture.TextureDimension);
|
||||
}
|
||||
|
||||
DeleteDictionaryAndKeys!(_textures);
|
||||
|
||||
Reference in New Issue
Block a user