Add BMF loading support

- Add ability to make textures not unloadable
This commit is contained in:
2025-12-14 22:59:16 +01:00
parent 38a1cad76a
commit 38a2b21ba0
5 changed files with 60 additions and 13 deletions

View File

@@ -105,6 +105,7 @@ class Iron {
public:
Drawlist() { DrawSolid(); }
~Drawlist() { pData.clear(); }
AMY_SHARED(Drawlist)
// required due to memory management
Drawlist(const Drawlist&) = delete;
@@ -122,7 +123,9 @@ class Iron {
void DrawSolid();
void DrawTex(Texture::Ref tex) { pTex = tex; }
void SetFont(Font::Ref fnt) { pCurrentFont = fnt; }
void SetFontScale(float v) { pFontScale = v; }
float GetFontScale() { return pFontScale; }
void DefaultFontScale() { pFontScale = 0.7; }
/** Draw Api */
void DrawRect(const fvec2& pos, const fvec2& size, ui color,
int thickness = 1);

View File

@@ -29,6 +29,8 @@ class Texture : public Asset {
// Dont set as loaded as only the root tex can be loaded
}
void Unload();
void Unloadable(bool v) { pLoaded = v; }
bool Unloadable() { return pLoaded; }
int W() const { return pSize.x; }
int& W() { return pSize.x; }