From 9590b58f0f246cb0ca67480e19fd2ccc71493352 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sat, 2 Dec 2017 17:46:09 +1100 Subject: [PATCH] [client] only init ttf if fps is enabled --- client/main.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/client/main.c b/client/main.c index 6c40284d..84c0a5c4 100644 --- a/client/main.c +++ b/client/main.c @@ -771,17 +771,20 @@ int run() return -1; } - if (TTF_Init() < 0) + if (params.showFPS) { - DEBUG_ERROR("TTL_Init Failed"); - return -1; - } + if (TTF_Init() < 0) + { + DEBUG_ERROR("TTL_Init Failed"); + return -1; + } - state.font = TTF_OpenFont("/usr/share/fonts/truetype/freefont/FreeMono.ttf", 16); - if (!state.font) - { - DEBUG_ERROR("TTL_OpenFont Failed"); - return -1; + state.font = TTF_OpenFont("/usr/share/fonts/truetype/freefont/FreeMono.ttf", 16); + if (!state.font) + { + DEBUG_ERROR("TTL_OpenFont Failed"); + return -1; + } } state.window = SDL_CreateWindow(