From b5b70a493135c8f9fa7c9b1ac6c67201c810cc35 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 16 Jan 2021 20:56:14 +0100 Subject: [PATCH] Increased the font texture buffers to avoid crashes when running at low resolutions. --- es-core/src/resources/Font.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/es-core/src/resources/Font.cpp b/es-core/src/resources/Font.cpp index b09e97d29..838478661 100644 --- a/es-core/src/resources/Font.cpp +++ b/es-core/src/resources/Font.cpp @@ -131,9 +131,10 @@ void Font::unloadTextures() Font::FontTexture::FontTexture(const int mSize) { textureId = 0; - // I'm not entirely sure if the 16 and 4 constants are correct, but they seem to provide - // a texture buffer large enough to hold the fonts. (Otherwise the application would crash.) - textureSize = Vector2i(mSize * 16, mSize * 4); + // I'm not entirely sure if the 16 and 6 constants are correct, but they seem to provide + // a texture buffer large enough to hold the fonts (otherwise the application would crash). + // This logic is obviously a hack though and needs to be properly reviewed and improved. + textureSize = Vector2i(mSize * 16, mSize * 6); writePos = Vector2i::Zero(); rowHeight = 0; }