diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-17 13:33:53 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-17 13:33:53 +0100 |
commit | 34a773eb0f01379419900a3fe26527702146b890 (patch) | |
tree | 6b8d1db513bb16dcdeb1928dcc374967cd9f7089 /src/crepe | |
parent | 707db8c94b6bb3921105f40658aab13511d8df07 (diff) |
last changes
Diffstat (limited to 'src/crepe')
-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); - } } |