[nostaliga/core] Add Drawer system and make ImGui use configurable

This commit is contained in:
2021-07-17 18:13:28 -05:00
parent d3a3d57773
commit 0420dfb545
6 changed files with 65 additions and 23 deletions
+13
View File
@@ -141,6 +141,19 @@ char charMap[128] = {
0, // ~
};
void addCustomDrawer(Context *ctx, Drawer *cd) noexcept {
ctx->drawer.emplace_back(cd);
}
void removeCustomDrawer(Context *ctx, Drawer *cd) noexcept {
for (auto i = 0u; i < ctx->drawer.size(); ++i) {
if (ctx->drawer[i] == cd) {
oxIgnoreError(ctx->drawer.erase(i));
break;
}
}
}
void setSprite(Context *c, const Sprite &s) noexcept {
setSprite(c, s.idx, s.x, s.y, s.tileIdx, s.spriteShape, s.spriteSize, s.flipX);
}