diff --git a/README.md b/README.md index 030cc93b0..c66eed75e 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,6 @@ Ready to learn? Jump to [code examples!](https://www.raylib.com/examples.html) [![Subreddit Subscribers](https://img.shields.io/reddit/subreddit-subscribers/raylib?label=reddit%20r%2Fraylib&logo=reddit)](https://www.reddit.com/r/raylib/) [![Youtube Subscribers](https://img.shields.io/youtube/channel/subscribers/UC8WIBkhYb5sBNqXO1mZ7WSQ?style=flat&label=Youtube&logo=youtube)](https://www.youtube.com/c/raylib) [![Twitch Status](https://img.shields.io/twitch/status/raysan5?style=flat&label=Twitch&logo=twitch)](https://www.twitch.tv/raysan5) -[![Twitter Followers](https://img.shields.io/twitter/follow/raysan5?style=flat&label=@raysan5&color=1da1f2&logo=twitter)](https://twitter.com/raysan5) - [![Windows](https://github.com/raysan5/raylib/workflows/Windows/badge.svg)](https://github.com/raysan5/raylib/actions?query=workflow%3AWindows) [![Linux](https://github.com/raysan5/raylib/workflows/Linux/badge.svg)](https://github.com/raysan5/raylib/actions?query=workflow%3ALinux) diff --git a/src/raylib.h b/src/raylib.h index 1c3f77669..10e69acdf 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -81,6 +81,9 @@ #include // Required for: va_list - Only used by TraceLogCallback +#define RAYLIB_VERSION_MAJOR 4 +#define RAYLIB_VERSION_MINOR 5 +#define RAYLIB_VERSION_PATCH 0 #define RAYLIB_VERSION "4.5-dev" // Function specifiers in case library is build/used as a shared library (Windows) diff --git a/src/rcore.c b/src/rcore.c index 23a6597a4..1f97edb2a 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -3310,7 +3310,7 @@ unsigned char *CompressData(const unsigned char *data, int dataSize, int *compDa compData = (unsigned char *)RL_CALLOC(bounds, 1); *compDataSize = sdeflate(&sdefl, compData, data, dataSize, COMPRESSION_QUALITY_DEFLATE); // Compression level 8, same as stbwi - TraceLog(LOG_INFO, "SYSTEM: Compress data: Original size: %i -> Comp. size: %i", dataSize, *compDataSize); + TRACELOG(LOG_INFO, "SYSTEM: Compress data: Original size: %i -> Comp. size: %i", dataSize, *compDataSize); #endif return compData; @@ -3335,7 +3335,7 @@ unsigned char *DecompressData(const unsigned char *compData, int compDataSize, i *dataSize = length; - TraceLog(LOG_INFO, "SYSTEM: Decompress data: Comp. size: %i -> Original size: %i", compDataSize, *dataSize); + TRACELOG(LOG_INFO, "SYSTEM: Decompress data: Comp. size: %i -> Original size: %i", compDataSize, *dataSize); #endif return data; @@ -6854,7 +6854,7 @@ static void LoadAutomationEvents(const char *fileName) if ((fileId[0] == 'r') && (fileId[1] == 'E') && (fileId[2] == 'P') && (fileId[1] == ' ')) { fread(&eventCount, sizeof(int), 1, repFile); - TraceLog(LOG_WARNING, "Events loaded: %i\n", eventCount); + TRACELOG(LOG_WARNING, "Events loaded: %i\n", eventCount); fread(events, sizeof(AutomationEvent), eventCount, repFile); } diff --git a/src/rmodels.c b/src/rmodels.c index b500e1e85..91ae68a3b 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -3939,12 +3939,12 @@ static Model LoadOBJ(const char *fileName) { model.materialCount = materialCount; model.materials = (Material *)RL_CALLOC(model.materialCount, sizeof(Material)); - TraceLog(LOG_INFO, "MODEL: model has %i material meshes", materialCount); + TRACELOG(LOG_INFO, "MODEL: model has %i material meshes", materialCount); } else { model.meshCount = 1; - TraceLog(LOG_INFO, "MODEL: No materials, putting all meshes in a default material"); + TRACELOG(LOG_INFO, "MODEL: No materials, putting all meshes in a default material"); } model.meshes = (Mesh *)RL_CALLOC(model.meshCount, sizeof(Mesh)); @@ -4452,6 +4452,12 @@ static ModelAnimation *LoadModelAnimationsIQM(const char *fileName, unsigned int unsigned int num_extensions, ofs_extensions; } IQMHeader; + typedef struct IQMJoint { + unsigned int name; + int parent; + float translate[3], rotate[4], scale[3]; + } IQMJoint; + typedef struct IQMPose { int parent; unsigned int mask; @@ -4505,6 +4511,10 @@ static ModelAnimation *LoadModelAnimationsIQM(const char *fileName, unsigned int //fread(framedata, iqmHeader->num_frames*iqmHeader->num_framechannels*sizeof(unsigned short), 1, iqmFile); memcpy(framedata, fileDataPtr + iqmHeader->ofs_frames, iqmHeader->num_frames*iqmHeader->num_framechannels*sizeof(unsigned short)); + // joints + IQMJoint *joints = RL_MALLOC(iqmHeader->num_joints*sizeof(IQMJoint)); + memcpy(joints, fileDataPtr + iqmHeader->ofs_joints, iqmHeader->num_joints*sizeof(IQMJoint)); + for (unsigned int a = 0; a < iqmHeader->num_anims; a++) { animations[a].frameCount = anim[a].num_frames; @@ -4515,7 +4525,11 @@ static ModelAnimation *LoadModelAnimationsIQM(const char *fileName, unsigned int for (unsigned int j = 0; j < iqmHeader->num_poses; j++) { - strcpy(animations[a].bones[j].name, "ANIMJOINTNAME"); + // If animations and skeleton are in the same file, copy bone names to anim + if (iqmHeader->num_joints > 0) + memcpy(animations[a].bones[j].name, fileDataPtr + iqmHeader->ofs_text + joints[j].name, BONE_NAME_LENGTH*sizeof(char)); + else + strcpy(animations[a].bones[j].name, "ANIMJOINTNAME"); // default bone name otherwise animations[a].bones[j].parent = poses[j].parent; } @@ -4629,6 +4643,7 @@ static ModelAnimation *LoadModelAnimationsIQM(const char *fileName, unsigned int RL_FREE(fileData); + RL_FREE(joints); RL_FREE(framedata); RL_FREE(poses); RL_FREE(anim); diff --git a/src/rtext.c b/src/rtext.c index f98386702..718fda04b 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -669,7 +669,7 @@ Image GenImageFontAtlas(const GlyphInfo *chars, Rectangle **charRecs, int glyphC if (chars == NULL) { - TraceLog(LOG_WARNING, "FONT: Provided chars info not valid, returning empty image atlas"); + TRACELOG(LOG_WARNING, "FONT: Provided chars info not valid, returning empty image atlas"); return atlas; }