aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system/RenderSystem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/system/RenderSystem.cpp')
-rw-r--r--src/crepe/system/RenderSystem.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/crepe/system/RenderSystem.cpp b/src/crepe/system/RenderSystem.cpp
index 18f6393..5fc98a9 100644
--- a/src/crepe/system/RenderSystem.cpp
+++ b/src/crepe/system/RenderSystem.cpp
@@ -152,16 +152,15 @@ void RenderSystem::render() {
void RenderSystem::render_text(Text & text, const Transform & tm) {
SDLContext & ctx = this->mediator.sdl_context;
- // Check if font is available in text
if (!text.font.has_value()) {
+ text.font = ctx.get_font_from_name(text.font_family);
}
ResourceManager & resource_manager = this->mediator.resource_manager;
- if (text.font.has_value()) {
+ if (!text.font.has_value()) {return;}
const Asset& font_asset = text.font.value();
const Font & res = resource_manager.get<Font>(font_asset);
- }
}