From 3d6df8ffbab4eec368d956e7a9cfe285a171df64 Mon Sep 17 00:00:00 2001 From: kolunmi Date: Sun, 7 Jan 2024 09:42:03 -0700 Subject: [PATCH] Enable animation names for the m3d model format. --- src/rmodels.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rmodels.c b/src/rmodels.c index 417142242..ede87a1b3 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -6050,7 +6050,8 @@ static ModelAnimation *LoadModelAnimationsM3D(const char *fileName, int *animCou animations[a].boneCount = m3d->numbone + 1; animations[a].bones = RL_MALLOC((m3d->numbone + 1)*sizeof(BoneInfo)); animations[a].framePoses = RL_MALLOC(animations[a].frameCount*sizeof(Transform *)); - // strncpy(animations[a].name, m3d->action[a].name, sizeof(animations[a].name)); + strncpy(animations[a].name, m3d->action[a].name, sizeof(animations[a].name)); + animations[a].name[sizeof(animations[a].name) - 1] = '\0'; TRACELOG(LOG_INFO, "MODEL: [%s] animation #%i: %i msec, %i frames", fileName, a, m3d->action[a].durationmsec, animations[a].frameCount); for (i = 0; i < (int)m3d->numbone; i++)