本文整理汇总了C++中FontPtr::_notifyOrigin方法的典型用法代码示例。如果您正苦于以下问题:C++ FontPtr::_notifyOrigin方法的具体用法?C++ FontPtr::_notifyOrigin怎么用?C++ FontPtr::_notifyOrigin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FontPtr
的用法示例。
在下文中一共展示了FontPtr::_notifyOrigin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: translate
//! [font_translate]
void FontTranslator::translate(ScriptCompiler* compiler, const AbstractNodePtr& node)
{
ObjectAbstractNode* obj = static_cast<ObjectAbstractNode*>(node.get());
// Must have a name - unless we are in legacy mode. Then the class is the name.
if (obj->name.empty() && obj->cls == "font")
{
compiler->addError(ScriptCompiler::CE_OBJECTNAMEEXPECTED, obj->file, obj->line,
"font must be given a name");
return;
}
String& name = obj->cls == "font" ? obj->name : obj->cls;
FontPtr font = FontManager::getSingleton().create(name, compiler->getResourceGroup());
font->_notifyOrigin(obj->file);
for (auto& c : obj->children)
{
if (c->type == ANT_PROPERTY)
{
parseAttribute(compiler, font, static_cast<PropertyAbstractNode*>(c.get()));
}
}
}
示例2: parseScript
//---------------------------------------------------------------------
void FontManager::parseScript(DataStreamPtr& stream, const String& groupName)
{
String line;
FontPtr pFont;
while( !stream->eof() )
{
line = stream->getLine();
// Ignore blanks & comments
if( !line.length() || line.substr( 0, 2 ) == "//" )
{
continue;
}
else
{
if (pFont.isNull())
{
// No current font
// So first valid data should be font name
if (StringUtil::startsWith(line, "font "))
{
// chop off the 'particle_system ' needed by new compilers
line = line.substr(5);
}
pFont = create(line, groupName);
pFont->_notifyOrigin(stream->getName());
// Skip to and over next {
stream->skipLine("{");
}
else
{
// Already in font
if (line == "}")
{
// Finished
pFont.setNull();
// NB font isn't loaded until required
}
else
{
parseAttribute(line, pFont);
}
}
}
}
}