diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index d44256d48..b3a40c041 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -1155,11 +1155,11 @@ void CMenus::RenderLanguageSelection(CUIRect MainView) // Load Font static CFont *pDefaultFont = 0; char aFilename[512]; - char *fontFile = "fonts/DejaVuSansCJKName.ttf"; + const char *pFontFile = "fonts/DejaVuSansCJKName.ttf"; if (str_find(g_Config.m_ClLanguagefile, "chinese") != NULL || str_find(g_Config.m_ClLanguagefile, "japanese") != NULL || str_find(g_Config.m_ClLanguagefile, "korean") != NULL) - fontFile = "fonts/DejavuWenQuanYiMicroHei.ttf"; - IOHANDLE File = Storage()->OpenFile(fontFile, IOFLAG_READ, IStorage::TYPE_ALL, aFilename, sizeof(aFilename)); + pFontFile = "fonts/DejavuWenQuanYiMicroHei.ttf"; + IOHANDLE File = Storage()->OpenFile(pFontFile, IOFLAG_READ, IStorage::TYPE_ALL, aFilename, sizeof(aFilename)); if(File) { io_close(File); @@ -1167,7 +1167,7 @@ void CMenus::RenderLanguageSelection(CUIRect MainView) TextRender()->SetDefaultFont(pDefaultFont); } if(!pDefaultFont) - Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "gameclient", "failed to load font. filename='%s'", fontFile); + Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "gameclient", "failed to load font. filename='%s'", pFontFile); } } diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index 34eebe4f3..4b6de67fc 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -294,11 +294,11 @@ void CGameClient::OnInit() // load default font static CFont *pDefaultFont = 0; char aFilename[512]; - char *fontFile = "fonts/DejaVuSansCJKName.ttf"; + const char *pFontFile = "fonts/DejaVuSansCJKName.ttf"; if (str_find(g_Config.m_ClLanguagefile, "chinese") != NULL || str_find(g_Config.m_ClLanguagefile, "japanese") != NULL || str_find(g_Config.m_ClLanguagefile, "korean") != NULL) - fontFile = "fonts/DejavuWenQuanYiMicroHei.ttf"; - IOHANDLE File = Storage()->OpenFile(fontFile, IOFLAG_READ, IStorage::TYPE_ALL, aFilename, sizeof(aFilename)); + pFontFile = "fonts/DejavuWenQuanYiMicroHei.ttf"; + IOHANDLE File = Storage()->OpenFile(pFontFile, IOFLAG_READ, IStorage::TYPE_ALL, aFilename, sizeof(aFilename)); if(File) { io_close(File); @@ -306,7 +306,7 @@ void CGameClient::OnInit() TextRender()->SetDefaultFont(pDefaultFont); } if(!pDefaultFont) - Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "gameclient", "failed to load font. filename='%s'", fontFile); + Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "gameclient", "failed to load font. filename='%s'", pFontFile); // init all components for(int i = m_All.m_Num-1; i >= 0; --i)