From a2935faae35ca9ebc640f764c3cfa6426fdf9740 Mon Sep 17 00:00:00 2001 From: oy Date: Tue, 5 Jul 2016 15:02:21 +0200 Subject: [PATCH] removed some unused functions --- src/engine/client/text.cpp | 17 ++++------------- src/engine/textrender.h | 5 +---- src/game/client/gameclient.cpp | 14 ++++++-------- 3 files changed, 11 insertions(+), 25 deletions(-) diff --git a/src/engine/client/text.cpp b/src/engine/client/text.cpp index 3c47c829e..b55e2dde5 100644 --- a/src/engine/client/text.cpp +++ b/src/engine/client/text.cpp @@ -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; } diff --git a/src/engine/textrender.h b/src/engine/textrender.h index ddd2be5b7..98f3207c4 100644 --- a/src/engine/textrender.h +++ b/src/engine/textrender.h @@ -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; diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index f9c3ba29e..fb56ef9e1 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -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