diff options
-rw-r--r-- | src/crepe/facade/SDLContext.h | 1 | ||||
-rw-r--r-- | src/crepe/system/RenderSystem.cpp | 5 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/crepe/facade/SDLContext.h b/src/crepe/facade/SDLContext.h index ffa3cc0..e348ff6 100644 --- a/src/crepe/facade/SDLContext.h +++ b/src/crepe/facade/SDLContext.h @@ -18,6 +18,7 @@ #include "types.h" #include "FontFacade.h" + namespace crepe { class Texture; 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); - } } |