From ea60f9f78bac505a5aeeb4d34b927f04ec3121b3 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sat, 11 Feb 2017 11:24:52 -0500 Subject: world bg, other fixes --- src/ui.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/ui.cpp') diff --git a/src/ui.cpp b/src/ui.cpp index b14ea2c..b9c2119 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -104,8 +104,7 @@ void loadFontSize(int size, std::vector &data) for (char i = 33; i < 126; i++) { // load the character from the font family file - if (FT_Load_Char(ftf, i, FT_LOAD_RENDER)) - UserError("Error! Unsupported character " + i); + UserAssert(!FT_Load_Char(ftf, i, FT_LOAD_RENDER), "Error! Unsupported character " + i); // transfer the character's bitmap (?) to a texture for rendering glBindTexture(GL_TEXTURE_2D, data[i - 33].tex); @@ -191,8 +190,7 @@ namespace ui { */ void initFonts(void) { - if (FT_Init_FreeType(&ftl)) - UserError("Couldn't initialize freetype."); + UserAssert(!FT_Init_FreeType(&ftl), "Couldn't initialize freetype."); #ifdef DEBUG DEBUG_printf("Initialized FreeType2.\n", nullptr); @@ -221,8 +219,8 @@ namespace ui { */ void setFontFace(const char *ttf) { - if (FT_New_Face(ftl, ttf, 0, &ftf)) - UserError("Error! Couldn't open " + (std::string)ttf + "."); + UserAssert(!FT_New_Face(ftl, ttf, 0, &ftf), "Error! Couldn't open " + + std::string(ttf) + "."); #ifdef DEBUG DEBUG_printf("Using font %s\n",ttf); -- cgit v1.2.3