我正在尝试解析.X文件(用于DirectX)以获取动画网格的fps ... .X文件使用模板数据。我想在模板中获取变量:AnimTicksPerSecond,但是,我无法告诉解析器识别此模板,因为我没有GUID ...是否有查找GUID的方法?这是我的解析器代码,它适用于标准模板,但AnimTicksPerSecond未在同一文件中定义(由DirectX SDK提供)。
BOOL cAnimationCollection::ParseObject(LPD3DXFILEDATA pDataObj, DWORD Depth, void **data)
{
if(pDataObj->IsReference())
return true;
if(CompareDataObjectType(pDataObj, TID_D3DRMAnimationSet)) //Animation Set is defined in rmxfguid.h(comes with DX SDK)
{
// Create and link Object
cAnimationSet *AnimSet = new cAnimationSet();
AnimSet->m_Next = m_AnimationSets;
m_AnimationSets = AnimSet;
// Increment # Animation Sets by 1
m_NumAnimationSets++;
// Set Animation Index to global count
AnimSet->m_index = index;
index++;
LPD3DXFILEDATA pSubData;
SIZE_T nChildren;
if(!strcmp(GetObjectName(pDataObj), "Unknown") || !(AnimSet->m_Name = GetObjectName(pDataObj)))
AnimSet->m_Name = _strdup("NewAnimationSet");
if(SUCCEEDED(pDataObj->GetChildren(&nChildren)))
for(SIZE_T index = 0; index < nChildren; index++)
if(SUCCEEDED(pDataObj->GetChild(index, &pSubData))){
ParseChildObjects(pSubData, Depth, data);
}
}
return true;
}
答案 0 :(得分:0)
AnimTicksPerSecond
的第一个Google结果是MSDN documentation,其中包含此声明:
template AnimTicksPerSecond
{
< 9E415A43-7BA6-4a73-8743-B73D47E88476 >
DWORD AnimTicksPerSecond;
}
看起来像是我的GUID。