Sources/CcgDump/CgfUtils.cpp
// Remaps the materials according to the given permutation
// the permutation is perm[new index] == old index

Remaps the materials according to the given permutation
the permutation is perm[new index] == old index
Remaps the materials according to the given permutation the permutation is perm [ new index ] == old index
void RemapMatEntities (MAT_ENTITY* pMtls, unsigned numMtls, unsigned* pPerm)
{
	MAT_ENTITY* pOldMtls = new MAT_ENTITY[numMtls];
	memcpy (pOldMtls, pMtls, sizeof(MAT_ENTITY)*numMtls);
	for (unsigned nNewMtl = 0; nNewMtl < numMtls; ++nNewMtl)
		memcpy (pMtls + nNewMtl, pOldMtls + pPerm[nNewMtl], sizeof(MAT_ENTITY));
	delete[]pOldMtls;	
}
void RemapMatEntities ( MAT_ENTITY * pMtls , unsigned numMtls , unsigned * pPerm ) { MAT_ENTITY * pOldMtls = new MAT_ENTITY [ numMtls ] ; memcpy ( pOldMtls , pMtls , sizeof ( MAT_ENTITY ) * numMtls ) ; for ( unsigned nNewMtl = 0 ; nNewMtl < numMtls ; ++ nNewMtl ) memcpy ( pMtls + nNewMtl , pOldMtls + pPerm [ nNewMtl ] , sizeof ( MAT_ENTITY ) ) ; delete [ ] pOldMtls ; }
Remaps the materials according to the given permutation
the permutation is perm[new index] == old index
Remaps the materials according to the given permutation the permutation is perm [ new index ] == old index