Exemple #1
0
static void _glhckTriStripReverse(glhckImportIndexData *indices, unsigned int memb)
{
   unsigned int i;
   glhckImportIndexData *original;

   if (!(original = _glhckCopy(indices, memb * sizeof(glhckImportIndexData))))
      return;

   for (i = 0; i != memb; ++i)
      indices[i] = original[memb-1-i];

   _glhckFree(original);
}
Exemple #2
0
/* \brief set weights to skin bone */
GLHCKAPI int glhckSkinBoneInsertWeights(glhckSkinBone *object, const glhckVertexWeight *weights, unsigned int memb)
{
   glhckVertexWeight *weightsCopy = NULL;
   CALL(0, "%p, %p, %u", object, weights, memb);
   assert(object);

   /* copy weights, if they exist */
   if (weights && !(weightsCopy = _glhckCopy(weights, memb * sizeof(glhckVertexWeight))))
      goto fail;

   IFDO(_glhckFree, object->weights);
   object->weights = weightsCopy;
   object->numWeights = (weightsCopy?memb:0);
   return RETURN_OK;

fail:
   return RETURN_FAIL;
}