From 621b044748833e90b14bf10f5ee200d4515ec5db Mon Sep 17 00:00:00 2001 From: Maddy Thorson Date: Tue, 2 Feb 2021 18:08:32 -0800 Subject: [PATCH] Moved Assets.bf. Sprites loading --- src/{Static => Assets}/Assets.bf | 7 ++++++- src/Assets/Sprite.bf | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) rename src/{Static => Assets}/Assets.bf (88%) diff --git a/src/Static/Assets.bf b/src/Assets/Assets.bf similarity index 88% rename from src/Static/Assets.bf rename to src/Assets/Assets.bf index 91f75a3..1285743 100644 --- a/src/Static/Assets.bf +++ b/src/Assets/Assets.bf @@ -7,6 +7,7 @@ namespace Strawberry static public class Assets { static public Dictionary Textures { get; private set; } + static public Dictionary Sprites { get; private set; } #if DEBUG static public readonly String Root = "../../../src/assets/"; @@ -28,13 +29,17 @@ namespace Strawberry static public void LoadAll() { - Textures = new Dictionary(); + Textures = new .(); Load("textures", "*.png", Textures, (path) => Game.PlatformLayer.LoadTexture(path)); + + Sprites = new .(); + Load("sprites", "*.ase", Sprites, (path) => { return new Sprite(new String(path)); }); } static public void DisposeAll() { DeleteDictionaryAndKeysAndValues!(Textures); + DeleteDictionaryAndKeysAndValues!(Sprites); Sprite.[Friend]Dispose(); } diff --git a/src/Assets/Sprite.bf b/src/Assets/Sprite.bf index a6bd6e9..932f46d 100644 --- a/src/Assets/Sprite.bf +++ b/src/Assets/Sprite.bf @@ -18,7 +18,7 @@ namespace Strawberry private List slices; private Modes mode; - private this(String path) + public this(String path) : base(path) { Load();