本文整理汇总了C++中ErrorHandler::print方法的典型用法代码示例。如果您正苦于以下问题:C++ ErrorHandler::print方法的具体用法?C++ ErrorHandler::print怎么用?C++ ErrorHandler::print使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ErrorHandler
的用法示例。
在下文中一共展示了ErrorHandler::print方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load
Penjin::ERRORS Text::load(CRstring name,CRuint fontSize)
{
ErrorHandler* eMan = ErrorMan::getInstance();
// check if fontSize is not the same as loaded font
if(this->fontSize != fontSize || name != getFileName())
{
clear();
#if PLATFORM_WII
font = TTF_OpenFont((Penjin::getWorkingDirectory() + name).c_str(), fontSize);
#else
font = TTF_OpenFont(name.c_str(), fontSize);
#endif
}
if(font)
{
setFileName(name);
// check if we already have Glyphs for this fontSize
if(glyphs.size() >= fontSize)
{
if(glyphs.at(fontSize-1).size())
{
// if the fontSize checks out...
if(glyphs.at(fontSize-1)[0]->getFontSize() == fontSize)
{
this->fontSize = fontSize;
#ifdef _DEBUG
eMan->print(PENJIN_OK,"Text: font loaded, Size: " + StringUtility::intToString(fontSize) + "Font: " + name);
#endif
return PENJIN_OK;
}
}
}
else
{
//Setup enough glyphs for fontSize
glyphs.resize(fontSize);
}
// create Dummy Char for spacing calcs
glyphs[fontSize-1].push_back(NULL);
glyphs[fontSize-1][0] = new Glyph();
glyphs[fontSize-1][0]->setFontSize(fontSize);
glyphs[fontSize-1][0]->setFont(font);
glyphs[fontSize-1][0]->setCharacter('-'); // picked because a nice square char to give us a "standard surface width"
glyphs[fontSize-1][0]->setPosition(cursorPos.getPosition());
glyphs[fontSize-1][0]->refresh();
setFileName(name);
this->fontSize = fontSize;
#ifdef _DEBUG
eMan->print(PENJIN_OK,"Text: font loaded, Size: " + StringUtility::intToString(fontSize) + "Font: " + name);
#endif
return PENJIN_OK;
}
eMan->print(PENJIN_TTF_UNABLE_TO_OPEN,"Text: Size: " + StringUtility::intToString(fontSize) + "Font: " + name);
return PENJIN_TTF_UNABLE_TO_OPEN;
}
示例2: return
Penjin::ERRORS Penjin::TextClass::init()
{
ErrorHandler* eMan = ErrorMan::getInstance();
if(isInitialised())
{
#ifdef _DEBUG
eMan->print(PENJIN_OK, "TextClass: SDL_TTF Initialised.");
#endif
return PENJIN_OK;
}
int result = TTF_Init();
if(result != 0)
{
result = PENJIN_ERROR;
}
else
{
result = PENJIN_OK;
}
eMan->print((Penjin::ERRORS)result,"TextClass::init()");
return (Penjin::ERRORS)result;
}