Implement UnloadModelAnimations (#1648)

This commit is contained in:
Hristo Stamenov 2021-03-14 20:30:18 +02:00 committed by GitHub
parent f7e48c95cd
commit bc9194690c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -1112,6 +1112,13 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame)
}
}
// Unload animation array data
void UnloadModelAnimations(ModelAnimation* animations, unsigned int count)
{
for (int i = 0; i < count; i++) UnloadModelAnimation(animations[i]);
RL_FREE(animations);
}
// Unload animation data
void UnloadModelAnimation(ModelAnimation anim)
{

View File

@ -1369,6 +1369,7 @@ RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId);
RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, int *animsCount); // Load model animations from file
RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose
RLAPI void UnloadModelAnimation(ModelAnimation anim); // Unload animation data
RLAPI void UnloadModelAnimations(ModelAnimation* animations, unsigned int count); // Unload animation array data
RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match
// Mesh generation functions