Asset loading structure complete.
Loads information from loader. information creates useable. Minor folder restructuring. Untested.
This commit is contained in:
9
RecrownedGTK/AssetsSystem/Information/IInfo.cs
Normal file
9
RecrownedGTK/AssetsSystem/Information/IInfo.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace RecrownedGTK.AssetsSystem.Information {
|
||||
public interface IInfo
|
||||
{
|
||||
Type type {get;}
|
||||
IDisposable CreateUseable();
|
||||
}
|
||||
}
|
14
RecrownedGTK/AssetsSystem/Information/NinePatchInfo.cs
Normal file
14
RecrownedGTK/AssetsSystem/Information/NinePatchInfo.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace RecrownedGTK.AssetsSystem.Information {
|
||||
public struct NinePatchInfo {
|
||||
public int leftBound, rightBound, bottomBound, topBound;
|
||||
public string name;
|
||||
|
||||
public NinePatchInfo(string name, int leftBound, int rightBound, int bottomBound, int topBound) {
|
||||
this.leftBound = leftBound;
|
||||
this.rightBound = rightBound;
|
||||
this.bottomBound = bottomBound;
|
||||
this.topBound = topBound;
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
}
|
24
RecrownedGTK/AssetsSystem/Information/TextureInfo.cs
Normal file
24
RecrownedGTK/AssetsSystem/Information/TextureInfo.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using RecrownedGTK.Graphics;
|
||||
|
||||
namespace RecrownedGTK.AssetsSystem.Information {
|
||||
public struct TextureInfo : IInfo {
|
||||
public string name;
|
||||
public byte[] textureData;
|
||||
int width, height;
|
||||
public Type type => typeof(TextureData);
|
||||
public TextureInfo(string name, int width, int height, byte[] textureData) {
|
||||
this.name = name;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.textureData = textureData;
|
||||
}
|
||||
|
||||
|
||||
public IDisposable CreateUseable()
|
||||
{
|
||||
TextureData data = new TextureData(textureData, width, height);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
32
RecrownedGTK/AssetsSystem/Information/TextureMapInfo.cs
Normal file
32
RecrownedGTK/AssetsSystem/Information/TextureMapInfo.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using RecrownedGTK.Types;
|
||||
|
||||
namespace RecrownedGTK.AssetsSystem.Information {
|
||||
public struct TextureMapInfo {
|
||||
public string pathToMap;
|
||||
public MapRegionInfo[] regionInfos;
|
||||
public TextureMapInfo(string pathToMap, params MapRegionInfo[] regionInfos) {
|
||||
this.pathToMap = pathToMap;
|
||||
this.regionInfos = regionInfos;
|
||||
}
|
||||
|
||||
public struct MapRegionInfo {
|
||||
public string name;
|
||||
public NinePatchInfo ninePatchInfo;
|
||||
public int x, y, width, height;
|
||||
public MapRegionInfo(string name, int x, int y, int width, int height, NinePatchInfo ninePatchInfo = default(NinePatchInfo)) {
|
||||
this.name = name;
|
||||
this.ninePatchInfo = ninePatchInfo;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
}
|
||||
public void SetBounds(int x, int y, int width, int height) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user