This commit is contained in:
Ray
2024-02-26 11:03:09 +01:00
parent 7d6e59170b
commit a6425fa1b9

View File

@@ -5282,6 +5282,8 @@ static Model LoadGLTF(const char *fileName)
} }
else if ((attribute->component_type == cgltf_component_type_r_16u) && (attribute->type == cgltf_type_vec2)) else if ((attribute->component_type == cgltf_component_type_r_16u) && (attribute->type == cgltf_type_vec2))
{ {
// TODO: WARNING: model.meshes[].boneIds is an (unsigned char *) --> Conversion required!
// Handle 16-bit unsigned short, vec2 format // Handle 16-bit unsigned short, vec2 format
model.meshes[meshIndex].boneIds = RL_CALLOC(model.meshes[meshIndex].vertexCount*2, sizeof(unsigned short)); model.meshes[meshIndex].boneIds = RL_CALLOC(model.meshes[meshIndex].vertexCount*2, sizeof(unsigned short));
unsigned short *ptr = (unsigned short *)model.meshes[meshIndex].boneIds; unsigned short *ptr = (unsigned short *)model.meshes[meshIndex].boneIds;
@@ -5289,6 +5291,8 @@ static Model LoadGLTF(const char *fileName)
} }
else if ((attribute->component_type == cgltf_component_type_r_16u) && (attribute->type == cgltf_type_vec4)) else if ((attribute->component_type == cgltf_component_type_r_16u) && (attribute->type == cgltf_type_vec4))
{ {
// TODO: WARNING: model.meshes[].boneIds is an (unsigned char *) --> Conversion required!
// Handle 16-bit unsigned short, vec4 format // Handle 16-bit unsigned short, vec4 format
model.meshes[meshIndex].boneIds = RL_CALLOC(model.meshes[meshIndex].vertexCount*4, sizeof(unsigned short)); model.meshes[meshIndex].boneIds = RL_CALLOC(model.meshes[meshIndex].vertexCount*4, sizeof(unsigned short));
unsigned short *ptr = (unsigned short *)model.meshes[meshIndex].boneIds; unsigned short *ptr = (unsigned short *)model.meshes[meshIndex].boneIds;
@@ -5296,12 +5300,17 @@ static Model LoadGLTF(const char *fileName)
} }
else if ((attribute->component_type == cgltf_component_type_r_32u) && (attribute->type == cgltf_type_vec4)) else if ((attribute->component_type == cgltf_component_type_r_32u) && (attribute->type == cgltf_type_vec4))
{ {
// TODO: WARNING: model.meshes[].boneIds is an (unsigned char *) --> Conversion required!
// Handle 32-bit unsigned int, vec4 format // Handle 32-bit unsigned int, vec4 format
model.meshes[meshIndex].boneIds = RL_CALLOC(model.meshes[meshIndex].vertexCount*4, sizeof(unsigned int)); model.meshes[meshIndex].boneIds = RL_CALLOC(model.meshes[meshIndex].vertexCount*4, sizeof(unsigned int));
LOAD_ATTRIBUTE(attribute, 4, unsigned int, model.meshes[meshIndex].boneIds) unsigned int *ptr = (unsigned int *)model.meshes[meshIndex].boneIds;
LOAD_ATTRIBUTE(attribute, 4, unsigned int, ptr)
} }
else if ((attribute->component_type == cgltf_component_type_r_32f) && (attribute->type == cgltf_type_vec2)) else if ((attribute->component_type == cgltf_component_type_r_32f) && (attribute->type == cgltf_type_vec2))
{ {
// TODO: WARNING: model.meshes[].boneIds is an (unsigned char *) --> Conversion required!
// Handle 32-bit float, vec2 format // Handle 32-bit float, vec2 format
model.meshes[meshIndex].boneIds = RL_CALLOC(model.meshes[meshIndex].vertexCount*2, sizeof(float)); model.meshes[meshIndex].boneIds = RL_CALLOC(model.meshes[meshIndex].vertexCount*2, sizeof(float));
float *ptr = (float *)model.meshes[meshIndex].boneIds; float *ptr = (float *)model.meshes[meshIndex].boneIds;