fix compile warning

This commit is contained in:
Tom 2016-03-03 23:40:19 +08:00
parent 26a1a9f331
commit ff1c6705d6
2 changed files with 8 additions and 8 deletions

View file

@ -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);
}
}

View file

@ -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)