Kaynağa Gözat

Added a check to ensure the material has a valid texture

pull/5518/head
ssszcmawo 2 gün önce
ebeveyn
işleme
823d8b6dad
1 değiştirilmiş dosya ile 7 ekleme ve 3 silme
  1. +7
    -3
      src/rmodels.c

+ 7
- 3
src/rmodels.c Dosyayı Görüntüle

@ -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;
}

Yükleniyor…
İptal
Kaydet