removed some unused functions

This commit is contained in:
oy 2016-07-05 15:02:21 +02:00
parent 23a1b80f60
commit a2935faae3
3 changed files with 11 additions and 25 deletions

View file

@ -459,7 +459,7 @@ public:
}
virtual CFont *LoadFont(const char *pFilename)
virtual int LoadFont(const char *pFilename)
{
CFont *pFont = (CFont *)mem_alloc(sizeof(CFont), 1);
@ -469,25 +469,16 @@ public:
if(FT_New_Face(m_FTLibrary, pFont->m_aFilename, 0, &pFont->m_FtFace))
{
mem_free(pFont);
return NULL;
return -1;
}
for(unsigned i = 0; i < NUM_FONT_SIZES; i++)
pFont->m_aSizes[i].m_FontSize = -1;
dbg_msg("textrender", "loaded pFont from '%s'", pFilename);
return pFont;
};
virtual void DestroyFont(CFont *pFont)
{
mem_free(pFont);
}
virtual void SetDefaultFont(CFont *pFont)
{
dbg_msg("textrender", "default pFont set %p", pFont);
m_pDefaultFont = pFont;
return 0;
}

View file

@ -36,10 +36,7 @@ class ITextRender : public IInterface
public:
virtual void SetCursor(CTextCursor *pCursor, float x, float y, float FontSize, int Flags) = 0;
virtual CFont *LoadFont(const char *pFilename) = 0;
virtual void DestroyFont(CFont *pFont) = 0;
virtual void SetDefaultFont(CFont *pFont) = 0;
virtual int LoadFont(const char *pFilename) = 0;
//
virtual void TextEx(CTextCursor *pCursor, const char *pText, int Length) = 0;

View file

@ -267,14 +267,12 @@ void CGameClient::OnInit()
if(File)
{
io_close(File);
pDefaultFont = TextRender()->LoadFont(aFilename);
TextRender()->SetDefaultFont(pDefaultFont);
}
if(!pDefaultFont)
{
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "failed to load font. filename='%s'", aFontName);
Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "gameclient", aBuf);
if(!TextRender()->LoadFont(aFilename))
{
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "failed to load font. filename='%s'", aFontName);
Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "gameclient", aBuf);
}
}
// init all components