summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorHristo Stamenov <[email protected]>2021-03-14 20:30:18 +0200
committerGitHub <[email protected]>2021-03-14 19:30:18 +0100
commitbc9194690c43a6a72d0fc9d16e29bc9831b030f9 (patch)
tree97612120d64a5b2b78138aa9872538b627c7bb7e /src
parentf7e48c95cd5224b6ca5d086b9693d4f8107046e6 (diff)
downloadraylib-bc9194690c43a6a72d0fc9d16e29bc9831b030f9.tar.gz
raylib-bc9194690c43a6a72d0fc9d16e29bc9831b030f9.zip
Implement UnloadModelAnimations (#1648)
Diffstat (limited to 'src')
-rw-r--r--src/models.c7
-rw-r--r--src/raylib.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/models.c b/src/models.c
index 145e08b3..591053ef 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 d08ead50..676b07f5 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