diff options
| author | Ray <[email protected]> | 2021-03-18 13:57:53 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2021-03-18 13:57:53 +0100 |
| commit | 664fbb87f5a88523fc76d835fe88528abfe46405 (patch) | |
| tree | 0171c0cae4c3feceeb34cf104452f91459956ac8 /src/models.c | |
| parent | ca1f2f9078f1af37f49e03c76f08930816561934 (diff) | |
| download | raylib-664fbb87f5a88523fc76d835fe88528abfe46405.tar.gz raylib-664fbb87f5a88523fc76d835fe88528abfe46405.zip | |
REVIEWED: Material params #1649
Just assigned a fixed memory size for custom Material parameters in case of being required, so we shouldn't worry about allocating/freeing them.
Diffstat (limited to 'src/models.c')
| -rw-r--r-- | src/models.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/models.c b/src/models.c index 729cc2a2..7c45afd2 100644 --- a/src/models.c +++ b/src/models.c @@ -797,15 +797,11 @@ void UnloadModel(Model model) // Unload meshes for (int i = 0; i < model.meshCount; i++) UnloadMesh(model.meshes[i]); - // Unload materials maps and params + // Unload materials maps // NOTE: As the user could be sharing shaders and textures between models, - // we don't unload the material but just free it's maps and params, + // we don't unload the material but just free it's maps, // the user is responsible for freeing models shaders and textures - for (int i = 0; i < model.materialCount; i++) - { - RL_FREE(model.materials[i].maps); - RL_FREE(model.materials[i].params); - } + for (int i = 0; i < model.materialCount; i++) RL_FREE(model.materials[i].maps); // Unload arrays RL_FREE(model.meshes); @@ -822,15 +818,11 @@ void UnloadModel(Model model) // Unload model (but not meshes) from memory (RAM and/or VRAM) void UnloadModelKeepMeshes(Model model) { - // Unload materials maps and params + // Unload materials maps // NOTE: As the user could be sharing shaders and textures between models, - // we don't unload the material but just free it's maps and params, + // we don't unload the material but just free it's maps, // the user is responsible for freeing models shaders and textures - for (int i = 0; i < model.materialCount; i++) - { - RL_FREE(model.materials[i].maps); - RL_FREE(model.materials[i].params); - } + for (int i = 0; i < model.materialCount; i++) RL_FREE(model.materials[i].maps); // Unload arrays RL_FREE(model.meshes); @@ -1013,7 +1005,6 @@ void UnloadMaterial(Material material) } RL_FREE(material.maps); - RL_FREE(material.params); } // Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) |
