本文整理汇总了C++中LLXmlTreeNode::getFastAttributeColor4U方法的典型用法代码示例。如果您正苦于以下问题:C++ LLXmlTreeNode::getFastAttributeColor4U方法的具体用法?C++ LLXmlTreeNode::getFastAttributeColor4U怎么用?C++ LLXmlTreeNode::getFastAttributeColor4U使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLXmlTreeNode
的用法示例。
在下文中一共展示了LLXmlTreeNode::getFastAttributeColor4U方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseXml
BOOL LLTexLayerParamColorInfo::parseXml(LLXmlTreeNode *node)
{
llassert(node->hasName("param") && node->getChildByName("param_color"));
if (!LLViewerVisualParamInfo::parseXml(node))
return FALSE;
LLXmlTreeNode* param_color_node = node->getChildByName("param_color");
if (!param_color_node)
{
return FALSE;
}
std::string op_string;
static LLStdStringHandle operation_string = LLXmlTree::addAttributeString("operation");
if (param_color_node->getFastAttributeString(operation_string, op_string))
{
LLStringUtil::toLower(op_string);
if (op_string == "add") mOperation = LLTexLayerParamColor::OP_ADD;
else if (op_string == "multiply") mOperation = LLTexLayerParamColor::OP_MULTIPLY;
else if (op_string == "blend") mOperation = LLTexLayerParamColor::OP_BLEND;
}
mNumColors = 0;
LLColor4U color4u;
for (LLXmlTreeNode* child = param_color_node->getChildByName("value");
child;
child = param_color_node->getNextNamedChild())
{
if ((mNumColors < MAX_COLOR_VALUES))
{
static LLStdStringHandle color_string = LLXmlTree::addAttributeString("color");
if (child->getFastAttributeColor4U(color_string, color4u))
{
mColors[ mNumColors ].setVec(color4u);
mNumColors++;
}
}
}
if (!mNumColors)
{
llwarns << "<param_color> is missing <value> sub-elements" << llendl;
return FALSE;
}
if ((mOperation == LLTexLayerParamColor::OP_BLEND) && (mNumColors != 1))
{
llwarns << "<param_color> with operation\"blend\" must have exactly one <value>" << llendl;
return FALSE;
}
return TRUE;
}