diff --git a/src/models.c b/src/models.c index 145e08b3d..591053ef0 100644 --- a/src/models.c +++ b/src/models.c @@ -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) { diff --git a/src/raylib.h b/src/raylib.h index d08ead503..676b07f5c 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -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