summaryrefslogtreecommitdiff
path: root/hgeft.cpp
diff options
context:
space:
mode:
authorGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-03-21 13:17:10 +0000
committerGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-03-21 13:17:10 +0000
commitc28783ee430b106b636bf636bddf0799126a19d5 (patch)
tree84752719e337f76093654c501ad5e44c80916ce6 /hgeft.cpp
parent614da8c13f4711337828a3b017d86002c6ea1292 (diff)
downloadbullet-lab-remix-c28783ee430b106b636bf636bddf0799126a19d5.tar.xz
Experimental support for cross compiling with mingw-w64.
Fix blinking HangUpText. Exit 1 if not terminated correctly.
Diffstat (limited to 'hgeft.cpp')
-rw-r--r--hgeft.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/hgeft.cpp b/hgeft.cpp
index 5beca1e..c067a1f 100644
--- a/hgeft.cpp
+++ b/hgeft.cpp
@@ -1,13 +1,14 @@
#include "hgeft.h"
+static const char* HGEFT_SRC_FN="hgeft.cpp";
void hgeTTChar::Free(){if(quad.tex)hge->Texture_Free(quad.tex),quad.tex=0;}
bool hgeTTChar::SetChar(wchar_t ch,FT_Face ttfface)
{
FT_GlyphSlot slot=ttfface->glyph;
FT_UInt glyph_index=FT_Get_Char_Index(ttfface,ch);
FT_Error err=FT_Load_Glyph(ttfface,glyph_index,FT_LOAD_DEFAULT);
- if(err)return false;
+ if(err){hge->System_Log("%s: Glyph load failed!",HGEFT_SRC_FN);return false;}
err=FT_Render_Glyph(ttfface->glyph,FT_RENDER_MODE_NORMAL);
- if(err)return false;
+ if(err){hge->System_Log("%s: Glyph render failed!",HGEFT_SRC_FN);return false;}
_w=slot->advance.x>>6;_h=slot->bitmap.rows;//we are one line only.
rw=slot->bitmap.width;rh=slot->bitmap.rows;
quad.tex=hge->Texture_Create(
@@ -46,9 +47,9 @@ void hgeTTChar::Render(double x,double y,DWORD col)
bool hgeTTFont::Init(const char *ttf,int size)
{
FT_Error err=FT_Init_FreeType(&libft);
- if(err)return false;
+ if(err){hge->System_Log("%s: Failed to initialize freetype",HGEFT_SRC_FN);return false;}
err=FT_New_Face(libft,ttf,0,&ttfface);
- if(err)return false;
+ if(err){hge->System_Log("%s: Failed to load font: %s",HGEFT_SRC_FN,ttf);return false;}
err=FT_Set_Char_Size(ttfface,0,size*64,96,96);
return true;
}