本文整理汇总了C++中CEffectCreator::InitBasicsFromXML方法的典型用法代码示例。如果您正苦于以下问题:C++ CEffectCreator::InitBasicsFromXML方法的具体用法?C++ CEffectCreator::InitBasicsFromXML怎么用?C++ CEffectCreator::InitBasicsFromXML使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEffectCreator
的用法示例。
在下文中一共展示了CEffectCreator::InitBasicsFromXML方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateFromXML
ALERROR CEffectCreator::CreateFromXML (SDesignLoadCtx &Ctx, CXMLElement *pDesc, const CString &sUNID, CEffectCreator **retpCreator)
// CreateFromXML
//
// Creates the creator from an XML element
{
ALERROR error;
CEffectCreator *pCreator;
// Basic info
CString sEffectUNID = sUNID;
if (sEffectUNID.IsBlank())
{
DWORD dwUNID = pDesc->GetAttributeInteger(UNID_ATTRIB);
if (dwUNID)
sEffectUNID = strFromInt(dwUNID, false);
else
sEffectUNID = STR_NO_UNID;
}
// Create the effect based on the child tag
if (pDesc->GetContentElementCount() == 0)
{
*retpCreator = NULL;
return NOERROR;
}
else if (pDesc->GetContentElementCount() == 1)
{
if (error = CreateSimpleFromXML(Ctx, pDesc->GetContentElement(0), sEffectUNID, &pCreator))
return error;
}
else
{
pCreator = new CEffectGroupCreator;
if (pCreator == NULL)
return ERR_MEMORY;
pCreator->m_sUNID = sEffectUNID;
// Type-specific creation
if (error = pCreator->OnEffectCreateFromXML(Ctx, pDesc, sEffectUNID))
return error;
}
// Initialize basic parameters
if (error = pCreator->InitBasicsFromXML(Ctx, pDesc))
return error;
// Done
*retpCreator = pCreator;
return NOERROR;
}