Simple font loading and rendering

This commit is contained in:
Matt Thorson
2020-06-15 00:56:01 -07:00
parent 2a9940d7bd
commit de0146e4e5
5 changed files with 113 additions and 26 deletions

View File

@ -24,17 +24,12 @@ namespace Strawberry
Load();
}
public ~this()
{
Unload();
}
public Frame this[int index]
{
get => frames[index];
}
private void Unload()
override protected void Unload()
{
for (let f in frames)
delete f;
@ -53,21 +48,14 @@ namespace Strawberry
delete slices;
}
public void Reload()
{
Unload();
Load();
}
private void Load()
override protected void Load()
{
/*
Aseprite file loading based on code from Noel Berry's Foster Framework here:
https://github.com/NoelFB/Foster/blob/master/Framework/Graphics/Images/Aseprite.cs
*/
let stream = scope FileStream();
stream.Open(Path, .Read, .Read);
let stream = OpenFileStream!();
//Helpers to match ASE file format spec
uint8 BYTE() => stream.Read<uint8>();