瀏覽代碼

Added a check to ensure the material has a valid texture

pull/5518/head
ssszcmawo 2 天之前
父節點
當前提交
823d8b6dad
共有 1 個檔案被更改,包括 7 行新增3 行删除
  1. +7
    -3
      src/rmodels.c

+ 7
- 3
src/rmodels.c 查看文件

@ -2228,10 +2228,14 @@ bool IsMaterialValid(Material material)
{
bool result = false;
">if ((material.maps != NULL) && // Validate material contain some map
(material.shader.id > 0)) result = true; // Validate material shader is valid
t">bool hasValidShader = ((material.maps != NULL) && // Validate material contain some maps
(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;
}

Loading…
取消
儲存