[client] only init ttf if fps is enabled

This commit is contained in:
Geoffrey McRae 2017-12-02 17:46:09 +11:00
parent f2216168f4
commit 9590b58f0f

View File

@ -771,17 +771,20 @@ int run()
return -1; return -1;
} }
if (TTF_Init() < 0) if (params.showFPS)
{ {
DEBUG_ERROR("TTL_Init Failed"); if (TTF_Init() < 0)
return -1; {
} DEBUG_ERROR("TTL_Init Failed");
return -1;
}
state.font = TTF_OpenFont("/usr/share/fonts/truetype/freefont/FreeMono.ttf", 16); state.font = TTF_OpenFont("/usr/share/fonts/truetype/freefont/FreeMono.ttf", 16);
if (!state.font) if (!state.font)
{ {
DEBUG_ERROR("TTL_OpenFont Failed"); DEBUG_ERROR("TTL_OpenFont Failed");
return -1; return -1;
}
} }
state.window = SDL_CreateWindow( state.window = SDL_CreateWindow(