diff options
| author | Ray <[email protected]> | 2024-02-26 11:03:09 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2024-02-26 11:03:09 +0100 |
| commit | a6425fa1b905f410e02def3d2f11f2d968358371 (patch) | |
| tree | 1b0b203a2a3ea353bcad56728bd655757f7411b4 /src/rmodels.c | |
| parent | 7d6e59170b0ad061f4734281da378d80b3135291 (diff) | |
| download | raylib-a6425fa1b905f410e02def3d2f11f2d968358371.tar.gz raylib-a6425fa1b905f410e02def3d2f11f2d968358371.zip | |
Added note #3822
Diffstat (limited to 'src/rmodels.c')
| -rw-r--r-- | src/rmodels.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/rmodels.c b/src/rmodels.c index 1a4374a3..4f634990 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -5282,29 +5282,38 @@ static Model LoadGLTF(const char *fileName) } 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 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; LOAD_ATTRIBUTE(attribute, 2, unsigned short, ptr) } 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 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; LOAD_ATTRIBUTE(attribute, 4, unsigned short, ptr) } 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 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)) { + // TODO: WARNING: model.meshes[].boneIds is an (unsigned char *) --> Conversion required! + // Handle 32-bit float, vec2 format 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; LOAD_ATTRIBUTE(attribute, 2, float, ptr) } else TRACELOG(LOG_WARNING, "MODEL: [%s] Joint attribute data format not supported", fileName); |
