From 889b2a62b563520c928dbf85e1d214fdc8e67a24 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Fri, 15 Jul 2022 16:40:12 +0300 Subject: [PATCH] 0 font page used instead of missing one --- src/graphics/Font.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/graphics/Font.cpp b/src/graphics/Font.cpp index b35257bd..1e627538 100644 --- a/src/graphics/Font.cpp +++ b/src/graphics/Font.cpp @@ -55,7 +55,11 @@ void Font::draw(Batch2D* batch, std::wstring text, int x, int y) { void Font::drawWithShadow(Batch2D* batch, std::wstring text, int x, int y) { for (unsigned c : text){ if (isPrintableChar(c)){ - batch->texture(pages[c >> 8]); + Texture* texture = pages[c >> 8]; + if (texture == nullptr){ + texture = pages[0]; + } + batch->texture(texture); batch->sprite(x+1, y+1, RES, RES, 16, c, vec4(0.0f, 0.0f, 0.0f, 1.0f)); batch->sprite(x+1, y-1, RES, RES, 16, c, vec4(0.0f, 0.0f, 0.0f, 1.0f)); batch->sprite(x-1, y, RES, RES, 16, c, vec4(0.0f, 0.0f, 0.0f, 1.0f));