Added a check to ensure the material has a valid texture
This commit is contained in:
parent
de7fc12be0
commit
823d8b6dad
|
|
@ -2228,10 +2228,14 @@ bool IsMaterialValid(Material material)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
if ((material.maps != NULL) && // Validate material contain some map
|
bool hasValidShader = ((material.maps != NULL) && // Validate material contain some maps
|
||||||
(material.shader.id > 0)) result = true; // Validate material shader is valid
|
(material.shader.id > 0)); // Validate material shader is valid
|
||||||
|
|
||||||
// TODO: Check if available maps contain loaded textures
|
bool hasValidTexture = ((material.maps != NULL) && // Validate material contain some maps
|
||||||
|
(material.maps->texture.id > 0)); // Validate material texture is valid
|
||||||
|
|
||||||
|
if (hasValidShader && hasValidTexture)
|
||||||
|
result = true;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user