Removed some NULL pointer checks
This commit is contained in:
parent
5735f13fe5
commit
d679a97e92
2 changed files with 13 additions and 16 deletions
22
src/rlgl.h
22
src/rlgl.h
|
@ -2727,18 +2727,18 @@ void rlDrawMesh(Mesh mesh, Material material, Matrix transform)
|
||||||
// Unload mesh data from CPU and GPU
|
// Unload mesh data from CPU and GPU
|
||||||
void rlUnloadMesh(Mesh *mesh)
|
void rlUnloadMesh(Mesh *mesh)
|
||||||
{
|
{
|
||||||
if (mesh->vertices != NULL) free(mesh->vertices);
|
free(mesh->vertices);
|
||||||
if (mesh->texcoords != NULL) free(mesh->texcoords);
|
free(mesh->texcoords);
|
||||||
if (mesh->normals != NULL) free(mesh->normals);
|
free(mesh->normals);
|
||||||
if (mesh->colors != NULL) free(mesh->colors);
|
free(mesh->colors);
|
||||||
if (mesh->tangents != NULL) free(mesh->tangents);
|
free(mesh->tangents);
|
||||||
if (mesh->texcoords2 != NULL) free(mesh->texcoords2);
|
free(mesh->texcoords2);
|
||||||
if (mesh->indices != NULL) free(mesh->indices);
|
free(mesh->indices);
|
||||||
|
|
||||||
if (mesh->baseVertices != NULL) free(mesh->baseVertices);
|
free(mesh->baseVertices);
|
||||||
if (mesh->baseNormals != NULL) free(mesh->baseNormals);
|
free(mesh->baseNormals);
|
||||||
if (mesh->weightBias != NULL) free(mesh->weightBias);
|
free(mesh->weightBias);
|
||||||
if (mesh->weightId != NULL) free(mesh->weightId);
|
free(mesh->weightId);
|
||||||
|
|
||||||
rlDeleteBuffers(mesh->vboId[0]); // vertex
|
rlDeleteBuffers(mesh->vboId[0]); // vertex
|
||||||
rlDeleteBuffers(mesh->vboId[1]); // texcoords
|
rlDeleteBuffers(mesh->vboId[1]); // texcoords
|
||||||
|
|
|
@ -353,7 +353,7 @@ Image LoadImageRaw(const char *fileName, int width, int height, int format, int
|
||||||
{
|
{
|
||||||
TraceLog(LOG_WARNING, "[%s] RAW image data can not be read, wrong requested format or size", fileName);
|
TraceLog(LOG_WARNING, "[%s] RAW image data can not be read, wrong requested format or size", fileName);
|
||||||
|
|
||||||
if (image.data != NULL) free(image.data);
|
free(image.data);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -414,10 +414,7 @@ RenderTexture2D LoadRenderTexture(int width, int height)
|
||||||
// Unload image from CPU memory (RAM)
|
// Unload image from CPU memory (RAM)
|
||||||
void UnloadImage(Image image)
|
void UnloadImage(Image image)
|
||||||
{
|
{
|
||||||
if (image.data != NULL) free(image.data);
|
free(image.data);
|
||||||
|
|
||||||
// NOTE: It becomes anoying every time a texture is loaded
|
|
||||||
//TraceLog(LOG_INFO, "Unloaded image data");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unload texture from GPU memory (VRAM)
|
// Unload texture from GPU memory (VRAM)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue