further MaterialDatabase checks
This commit is contained in:
parent
41bad6c97c
commit
986db9cfc5
@ -188,15 +188,21 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
inline MaterialRenderProfileConstPtr MaterialDatabase::materialRenderProfile(MaterialId materialId) const {
|
inline MaterialRenderProfileConstPtr MaterialDatabase::materialRenderProfile(MaterialId materialId) const {
|
||||||
if (materialId >= m_materials.size())
|
if (materialId < m_materials.size()) {
|
||||||
|
if (auto const& mat = m_materials[materialId])
|
||||||
|
return mat->materialRenderProfile;
|
||||||
|
}
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
return m_materials[materialId]->materialRenderProfile;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline MaterialRenderProfileConstPtr MaterialDatabase::modRenderProfile(ModId modId) const {
|
inline MaterialRenderProfileConstPtr MaterialDatabase::modRenderProfile(ModId modId) const {
|
||||||
if (modId >= m_mods.size())
|
if (modId < m_mods.size()) {
|
||||||
|
if (auto const& mod = m_mods[modId])
|
||||||
|
return mod->modRenderProfile;
|
||||||
|
}
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
return m_mods[modId]->modRenderProfile;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool MaterialDatabase::foregroundLightTransparent(MaterialId materialId) const {
|
inline bool MaterialDatabase::foregroundLightTransparent(MaterialId materialId) const {
|
||||||
|
@ -106,7 +106,6 @@ bool TileDrawer::produceTerrainDrawables(Drawables& drawables,
|
|||||||
};
|
};
|
||||||
|
|
||||||
auto materialRenderProfile = materialDatabase->materialRenderProfile(material);
|
auto materialRenderProfile = materialDatabase->materialRenderProfile(material);
|
||||||
|
|
||||||
auto modRenderProfile = materialDatabase->modRenderProfile(mod);
|
auto modRenderProfile = materialDatabase->modRenderProfile(mod);
|
||||||
|
|
||||||
if (materialRenderProfile) {
|
if (materialRenderProfile) {
|
||||||
|
@ -277,7 +277,6 @@ bool TilePainter::produceTerrainPrimitives(HashMap<QuadZLevel, List<RenderPrimit
|
|||||||
};
|
};
|
||||||
|
|
||||||
auto materialRenderProfile = materialDatabase->materialRenderProfile(material);
|
auto materialRenderProfile = materialDatabase->materialRenderProfile(material);
|
||||||
|
|
||||||
auto modRenderProfile = materialDatabase->modRenderProfile(mod);
|
auto modRenderProfile = materialDatabase->modRenderProfile(mod);
|
||||||
|
|
||||||
if (materialRenderProfile) {
|
if (materialRenderProfile) {
|
||||||
|
Loading…
Reference in New Issue
Block a user