From 6ed1f4662df2120d66ab99d024ebd4516d66e7e0 Mon Sep 17 00:00:00 2001 From: Quantum Date: Mon, 26 Jul 2021 03:05:52 -0400 Subject: [PATCH] [client] imgui: report failed font atlas building Also removed the inefficient code to build the default atlas. --- client/src/main.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/client/src/main.c b/client/src/main.c index dd7a86cb..5c504d9c 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -193,7 +193,8 @@ static int renderThread(void * unused) g_params.uiSize * g_state.windowScale, NULL, NULL); g_state.fontLarge = ImFontAtlas_AddFontFromFileTTF(g_state.io->Fonts, g_state.fontName, 1.3f * g_params.uiSize * g_state.windowScale, NULL, NULL); - ImFontAtlas_Build(g_state.io->Fonts); + if (!ImFontAtlas_Build(g_state.io->Fonts)) + DEBUG_FATAL("Failed to build font atlas: %s (%s)", g_params.uiFont, g_state.fontName); if (g_state.lgr) g_state.lgr->on_resize(g_state.lgrData, g_state.windowW, g_state.windowH, @@ -779,11 +780,6 @@ static int lg_run(void) g_state.io = igGetIO(); g_state.style = igGetStyle(); - unsigned char *text_pixels = NULL; - int text_w, text_h; - ImFontAtlas_GetTexDataAsRGBA32(g_state.io->Fonts, &text_pixels, - &text_w, &text_h, NULL); - g_state.windowScale = 1.0; g_state.fontName = util_getUIFont(g_params.uiFont); DEBUG_INFO("Using font: %s", g_state.fontName);