aboutsummaryrefslogtreecommitdiff
path: root/src/crepe
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe')
-rw-r--r--src/crepe/facade/SDLContext.h1
-rw-r--r--src/crepe/system/RenderSystem.cpp5
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);
- }
}