// Read data from buffer and place it in BinaryStream for decoder.
// Just "Count" because always is used type equivalent to uint8_t.
- bstream.LoadFromBuffer(&buf->GetPointer()[pCompression_Open3DGC.Offset], pCompression_Open3DGC.Count);
+ bstream.LoadFromBuffer(&buf->GetPointer()[pCompression_Open3DGC.Offset], static_cast<unsigned long>(pCompression_Open3DGC.Count));
// After decoding header we can get size of primitives.
if(decoder.DecodeHeader(ifs, bstream) != o3dgc::O3DGC_OK) throw DeadlyImportError("GLTF: can not decode Open3DGC header.");
{
// size = number_of_elements * components_per_element * size_of_component.
// Note. But as you can see above, at first we are use this variable in meaning "count". After checking count of objects...
- size_t tval = ifs.GetNFloatAttribute(idx);
+ size_t tval = ifs.GetNFloatAttribute(static_cast<unsigned long>(idx));
- switch(ifs.GetFloatAttributeType(idx))
+ switch(ifs.GetFloatAttributeType(static_cast<unsigned long>(idx)))
{
case o3dgc::O3DGC_IFS_FLOAT_ATTRIBUTE_TYPE_TEXCOORD:
// Check situation when encoded data contain texture coordinates but primitive not.
}
else
{
- ifs.SetNFloatAttribute(idx, 0);// Disable decoding this attribute.
+ ifs.SetNFloatAttribute(static_cast<unsigned long>(idx), 0ul);// Disable decoding this attribute.
}
break;
default:
- throw DeadlyImportError("GLTF: Open3DGC. Unsupported type of float attribute: " + to_string(ifs.GetFloatAttributeType(idx)));
+ throw DeadlyImportError("GLTF: Open3DGC. Unsupported type of float attribute: " + to_string(ifs.GetFloatAttributeType(static_cast<unsigned long>(idx))));
}
- tval *= ifs.GetFloatAttributeDim(idx) * sizeof(o3dgc::Real);// After checking count of objects we can get size of array.
+ tval *= ifs.GetFloatAttributeDim(static_cast<unsigned long>(idx)) * sizeof(o3dgc::Real);// After checking count of objects we can get size of array.
size_floatattr[idx] = tval;
decoded_data_size += tval;
}
for(size_t idx = 0, idx_end = size_intattr.size(); idx < idx_end; idx++)
{
// size = number_of_elements * components_per_element * size_of_component. See float attributes note.
- size_t tval = ifs.GetNIntAttribute(idx);
- switch( ifs.GetIntAttributeType( idx ) )
+ size_t tval = ifs.GetNIntAttribute(static_cast<unsigned long>(idx));
+ switch( ifs.GetIntAttributeType(static_cast<unsigned long>(idx) ) )
{
default:
- throw DeadlyImportError("GLTF: Open3DGC. Unsupported type of int attribute: " + to_string(ifs.GetIntAttributeType(idx)));
+ throw DeadlyImportError("GLTF: Open3DGC. Unsupported type of int attribute: " + to_string(ifs.GetIntAttributeType(static_cast<unsigned long>(idx))));
}
- tval *= ifs.GetIntAttributeDim(idx) * sizeof(long);// See float attributes note.
+ tval *= ifs.GetIntAttributeDim(static_cast<unsigned long>(idx)) * sizeof(long);// See float attributes note.
size_intattr[idx] = tval;
decoded_data_size += tval;
}
for(size_t idx = 0, idx_end = size_floatattr.size(), idx_texcoord = 0; idx < idx_end; idx++)
{
- switch(ifs.GetFloatAttributeType(idx))
+ switch(ifs.GetFloatAttributeType(static_cast<unsigned long>(idx)))
{
case o3dgc::O3DGC_IFS_FLOAT_ATTRIBUTE_TYPE_TEXCOORD:
if(idx_texcoord < primitives[0].attributes.texcoord.size())
{
// See above about absent attributes.
- ifs.SetFloatAttribute(idx, (o3dgc::Real* const)(decoded_data + get_buf_offset(primitives[0].attributes.texcoord[idx])));
+ ifs.SetFloatAttribute(static_cast<unsigned long>(idx), (o3dgc::Real* const)(decoded_data + get_buf_offset(primitives[0].attributes.texcoord[idx])));
idx_texcoord++;
}
break;
default:
- throw DeadlyImportError("GLTF: Open3DGC. Unsupported type of float attribute: " + to_string(ifs.GetFloatAttributeType(idx)));
+ throw DeadlyImportError("GLTF: Open3DGC. Unsupported type of float attribute: " + to_string(ifs.GetFloatAttributeType(static_cast<unsigned long>(idx))));
}
}
for(size_t idx = 0, idx_end = size_intattr.size(); idx < idx_end; idx++)
{
- switch(ifs.GetIntAttributeType(idx))
+ switch(ifs.GetIntAttributeType(static_cast<unsigned long>(idx)))
{
// ifs.SetIntAttribute(idx, (long* const)(decoded_data + get_buf_offset(primitives[0].attributes.joint)));
default:
- throw DeadlyImportError("GLTF: Open3DGC. Unsupported type of int attribute: " + to_string(ifs.GetIntAttributeType(idx)));
+ throw DeadlyImportError("GLTF: Open3DGC. Unsupported type of int attribute: " + to_string(ifs.GetIntAttributeType(static_cast<unsigned long>(idx))));
}
}
mScene = sceneCopy.get();
- std::unique_ptr<Asset> asset();
mAsset.reset( new glTF::Asset( pIOSystem ) );
if (isBinary) {
aiMatrix4x4 tmpMatrix4;
CopyValue(aib->mOffsetMatrix, tmpMatrix4);
inverseBindMatricesData.push_back(tmpMatrix4);
- jointNamesIndex = inverseBindMatricesData.size() - 1;
+ jointNamesIndex = static_cast<unsigned int>(inverseBindMatricesData.size() - 1);
}
// aib->mWeights =====> vertexWeightData
{
size_t num = comp_o3dgc_ifs.GetNumFloatAttributes();
- comp_o3dgc_params.SetFloatAttributeQuantBits(num, quant_texcoord);
- comp_o3dgc_params.SetFloatAttributePredMode(num, prediction_texcoord);
- comp_o3dgc_ifs.SetNFloatAttribute(num, aim->mNumVertices);// number of elements.
- comp_o3dgc_ifs.SetFloatAttributeDim(num, aim->mNumUVComponents[num_tc]);// components per element: aiVector3D => x * float
- comp_o3dgc_ifs.SetFloatAttributeType(num, o3dgc::O3DGC_IFS_FLOAT_ATTRIBUTE_TYPE_TEXCOORD);
- comp_o3dgc_ifs.SetFloatAttribute(num, (o3dgc::Real* const)&b->GetPointer()[idx_srcdata_tc[num_tc]]);
- comp_o3dgc_ifs.SetNumFloatAttributes(num + 1);
+ comp_o3dgc_params.SetFloatAttributeQuantBits(static_cast<unsigned long>(num), quant_texcoord);
+ comp_o3dgc_params.SetFloatAttributePredMode(static_cast<unsigned long>(num), prediction_texcoord);
+ comp_o3dgc_ifs.SetNFloatAttribute(static_cast<unsigned long>(num), aim->mNumVertices);// number of elements.
+ comp_o3dgc_ifs.SetFloatAttributeDim(static_cast<unsigned long>(num), aim->mNumUVComponents[num_tc]);// components per element: aiVector3D => x * float
+ comp_o3dgc_ifs.SetFloatAttributeType(static_cast<unsigned long>(num), o3dgc::O3DGC_IFS_FLOAT_ATTRIBUTE_TYPE_TEXCOORD);
+ comp_o3dgc_ifs.SetFloatAttribute(static_cast<unsigned long>(num), (o3dgc::Real* const)&b->GetPointer()[idx_srcdata_tc[num_tc]]);
+ comp_o3dgc_ifs.SetNumFloatAttributes(static_cast<unsigned long>(num + 1));
}
// Coordinates indices
CopyValue(inverseBindMatricesData[idx_joint], invBindMatrixData[idx_joint]);
}
- Ref<Accessor> invBindMatrixAccessor = ExportData(*mAsset, skinName, b, inverseBindMatricesData.size(), invBindMatrixData, AttribType::MAT4, AttribType::MAT4, ComponentType_FLOAT);
+ Ref<Accessor> invBindMatrixAccessor = ExportData(*mAsset, skinName, b, static_cast<unsigned int>(inverseBindMatricesData.size()), invBindMatrixData, AttribType::MAT4, AttribType::MAT4, ComponentType_FLOAT);
if (invBindMatrixAccessor) skinRef->inverseBindMatrices = invBindMatrixAccessor;
// Identity Matrix =====> skinRef->bindShapeMatrix