diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2017-02-11 11:24:52 -0500 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2017-02-11 11:24:52 -0500 |
commit | ea60f9f78bac505a5aeeb4d34b927f04ec3121b3 (patch) | |
tree | 15c617c9293c5a3b1011be0a19cb85396f49a3fc /src/ui.cpp | |
parent | 27892bc40122494385bdbe5eb84aee52737f9c13 (diff) |
world bg, other fixes
Diffstat (limited to 'src/ui.cpp')
-rw-r--r-- | src/ui.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -104,8 +104,7 @@ void loadFontSize(int size, std::vector<FT_Info> &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); |