mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
removed some unused functions
This commit is contained in:
parent
23a1b80f60
commit
a2935faae3
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -267,15 +267,13 @@ void CGameClient::OnInit()
|
|||
if(File)
|
||||
{
|
||||
io_close(File);
|
||||
pDefaultFont = TextRender()->LoadFont(aFilename);
|
||||
TextRender()->SetDefaultFont(pDefaultFont);
|
||||
}
|
||||
if(!pDefaultFont)
|
||||
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
|
||||
for(int i = m_All.m_Num-1; i >= 0; --i)
|
||||
|
|
Loading…
Reference in a new issue