当前位置: 首页>>代码示例>>C++>>正文


C++ LLXmlTreeNode::getFastAttributeUUID方法代码示例

本文整理汇总了C++中LLXmlTreeNode::getFastAttributeUUID方法的典型用法代码示例。如果您正苦于以下问题:C++ LLXmlTreeNode::getFastAttributeUUID方法的具体用法?C++ LLXmlTreeNode::getFastAttributeUUID怎么用?C++ LLXmlTreeNode::getFastAttributeUUID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LLXmlTreeNode的用法示例。


在下文中一共展示了LLXmlTreeNode::getFastAttributeUUID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: loadNodeArchetype

//-----------------------------------------------------------------------------
// loadNodeArchetype(): loads <archetype> node from XML tree
//-----------------------------------------------------------------------------
BOOL LLGenePool::loadNodeArchetype( LLXmlTreeNode* node )
{
	llassert( node->hasName( "archetype" ) );

	LLAppearance* archetype = new LLAppearance();
	BOOL success = TRUE;

	LLVOAvatar* avatar = gAgent.getAvatarObject();
	if( !avatar )
	{
		delete archetype;
		return FALSE;
	}

	LLXmlTreeNode* child;
	for (child = node->getChildByName( "param" );
		 child;
		 child = node->getNextNamedChild())
	{
		F32 value;
		static LLStdStringHandle value_string = LLXmlTree::addAttributeString("value");
		if( !child->getFastAttributeF32( value_string, value ) )
		{
			llwarns << "avatar genepool file: <param> missing value attribute" << llendl;
			success = FALSE;
			break;
		}
			
		S32 id;
		static LLStdStringHandle id_string = LLXmlTree::addAttributeString("id");
		if( !child->getFastAttributeS32( id_string, id ) )
		{
			llwarns << "avatar genepool file: <param> missing id attribute" << llendl;
			success = FALSE;
			break;
		}

		LLVisualParam* param = avatar->getVisualParam( id );
		if( param )
		{
			archetype->addParam( id, value );
		}
		else
		{
			llwarns << "avatar genepool file: ignoring invalid <param> with id: " << id << llendl;
		}
	}
	for (child = node->getChildByName( "texture" );
		 child;
		 child = node->getNextNamedChild())
	{
		LLUUID uuid;
		static LLStdStringHandle uuid_string = LLXmlTree::addAttributeString("uuid");
		if( !child->getFastAttributeUUID( uuid_string, uuid ) )
		{
			llwarns << "avatar genepool file: <texture> missing uuid attribute" << llendl;
			success = FALSE;
			break;
		}
			
		S32 te;
		static LLStdStringHandle te_string = LLXmlTree::addAttributeString("te");
		if( !child->getFastAttributeS32( te_string, te ) )
		{
			llwarns << "avatar genepool file: <texture> missing te attribute" << llendl;
			success = FALSE;
			break;
		}

		archetype->addTexture( te, uuid );
	}

	if( success )
	{
		mArchetypes.put( archetype );
	}
	else
	{
		delete archetype;
	}
	return success;
}
开发者ID:Boy,项目名称:rainbow,代码行数:85,代码来源:llgenepool.cpp


注:本文中的LLXmlTreeNode::getFastAttributeUUID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。