本文整理汇总了C++中CArray::Fill方法的典型用法代码示例。如果您正苦于以下问题:C++ CArray::Fill方法的具体用法?C++ CArray::Fill怎么用?C++ CArray::Fill使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CArray
的用法示例。
在下文中一共展示了CArray::Fill方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: oFileEntry
CGMeshMD5::CModel * CGmResMan::NewModelMD5( const char *pcFileNameMesh, const CArray<CStr> &roArrFileNameAnim, bool bTexSmooth )
{
CGMeshMD5::CModel *poModel = 0;
CStr oFileEntry( pcFileNameMesh );
for( unsigned int i=0; i<roArrFileNameAnim.GetSize(); ++i )
{
oFileEntry += "&";
oFileEntry += roArrFileNameAnim[i];
}
poModel = (CGMeshMD5::CModel *)FindFileEntry( oFileEntry.GetData() );
if( !poModel )
{
poModel = new CGMeshMD5::CModel;
//if( !MakeModelMD5_( poModel, pcFileNameMesh, roArrFileNameAnim, bTexSmooth ) )
//{
// ERR( "ModelMD5 %s.\n", pcFileNameMesh );
// DELETE_INSTANCE( poModel );
// return 0;
//}
{
if( !poModel->InitModel( DATA_DIR + /*"model/" +*/ pcFileNameMesh ) )
{
ERR( "ModelMD5 %s.\n", pcFileNameMesh );
DELETE_INSTANCE( poModel );
return 0;
}
CArray<CGTex2 *> oArrTex;
const unsigned int uiMeshCount = poModel->GetMeshCount();
oArrTex.Resize( uiMeshCount );
oArrTex.Fill( 0 );
unsigned int i = uiMeshCount;
while( i )
{
--i;
const char *pcMaterialName = poModel->GetMaterialName( i );
if( pcMaterialName )
{
oArrTex[i] = NewTexture( pcMaterialName, bTexSmooth, false );
}
}
const unsigned int uiAnimCount = roArrFileNameAnim.GetSize();
for( unsigned int uiAnim=0; uiAnim<uiAnimCount; ++uiAnim )
{
LOG( "Loading %s.\n", roArrFileNameAnim[uiAnim].GetData() );
if( poModel->InsertNewAnim( DATA_DIR + /*"model/" +*/ roArrFileNameAnim[uiAnim] ) )
{
for( unsigned int i=0; i<uiMeshCount; ++i )
{
if( oArrTex.GetSize() >= i && oArrTex[i] )
{
poModel->SetTex( i, uiAnim, oArrTex[i] );
}
}
}
}
poModel->SetAnim( poModel->GetAnimCount() - 1 );
}
m_oArrModelMD5.Append( poModel );
NewFileEntry( oFileEntry.GetData(), poModel );
}
else
{
LOG( "ModelMD5 skipped: %s.\n", pcFileNameMesh );
}
//else
//{
// // copy with shared data
// poModel = new CGMeshMD5::CModel( *poModel );
//
// m_oArrModelMD5.Append( poModel );
// LOG( "ModelMD5 copied: %s.\n", pcFileNameMesh );
//}
return poModel;
}