Graphics/BasicMaterial: Add IsAlphaTestEnabled()

This commit is contained in:
Jérôme Leclercq 2021-06-16 15:00:45 +02:00
parent 3cd9172f7a
commit 298beaedc0
2 changed files with 8 additions and 0 deletions

View File

@ -30,6 +30,8 @@ namespace Nz
inline const std::shared_ptr<Texture>& GetDiffuseMap() const;
inline const TextureSamplerInfo& GetDiffuseSampler() const;
inline bool IsAlphaTestEnabled() const;
inline bool HasAlphaMap() const;
inline bool HasAlphaTest() const;
inline bool HasAlphaTestThreshold() const;

View File

@ -53,6 +53,12 @@ namespace Nz
return m_material.GetTextureSampler(m_textureIndexes.diffuse);
}
inline bool BasicMaterial::IsAlphaTestEnabled() const
{
NazaraAssert(HasAlphaTest(), "Material has no alpha test condition");
return m_material.IsConditionEnabled(m_conditionIndexes.alphaTest);
}
inline bool BasicMaterial::HasAlphaMap() const
{
return m_textureIndexes.alpha != MaterialSettings::InvalidIndex;