diff options
Diffstat (limited to 'src/models.c')
| -rw-r--r-- | src/models.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/models.c b/src/models.c index 64a8d3b..2db4b5b 100644 --- a/src/models.c +++ b/src/models.c @@ -6,6 +6,10 @@ #include "textures.h" #include "core.h" +void unloadMaterial( Material *material ) { + free( material->maps ); +} + // Unload model (but not meshes) from memory (RAM and/or VRAM) void UnloadModelKeepMeshes( Model model ) { // Unload materials maps @@ -23,7 +27,7 @@ void UnloadModelKeepMeshes( Model model ) { RL_FREE(model.bones); RL_FREE(model.bindPose); - TRACELOG(LOG_INFO, "MODEL: Unloaded model (but not meshes) from RAM and VRAM"); + TraceLog( LOG_INFO, "MODEL: Unloaded model (but not meshes) from RAM and VRAM" ); } void DrawBillboardProNoRatio( Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint ) { @@ -1194,7 +1198,7 @@ int lmodelsUnloadMaterial( lua_State *L ) { Material *material = uluaGetMaterial( L, 1 ); /* Custom UnloadMaterial since we don't want to free Shaders or Textures. */ - RL_FREE( material->maps ); + unloadMaterial( material ); // UnloadMaterial( *material ); |
