//FIXME: these 3 functions up there could use some refactoring shared_ptr <GLTFBufferView> convertIntArrayToGLTFBufferView(const COLLADAFW::IntValuesArray &array) { unsigned char* sourceData = (unsigned char*)array.getData(); size_t sourceSize = array.getCount() * sizeof(int); unsigned char* copiedData = (unsigned char*)malloc(sourceSize); memcpy(copiedData, sourceData, sourceSize); shared_ptr <GLTF::GLTFBufferView> bufferView = createBufferViewWithAllocatedBuffer(copiedData, 0, sourceSize, true); return bufferView; }
// when src is const we cannot src.yieldOwnerShip, this is used by copy constructor void SkinInfo::transfer_int_array_data_const(const COLLADAFW::IntValuesArray& src, COLLADAFW::IntValuesArray& dest) { dest.setData((int*)src.getData(), src.getCount()); dest.yieldOwnerShip(); }