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()) {
|
||||||
return {};
|
if (auto const& mat = m_materials[materialId])
|
||||||
return m_materials[materialId]->materialRenderProfile;
|
return mat->materialRenderProfile;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
inline MaterialRenderProfileConstPtr MaterialDatabase::modRenderProfile(ModId modId) const {
|
inline MaterialRenderProfileConstPtr MaterialDatabase::modRenderProfile(ModId modId) const {
|
||||||
if (modId >= m_mods.size())
|
if (modId < m_mods.size()) {
|
||||||
return {};
|
if (auto const& mod = m_mods[modId])
|
||||||
return m_mods[modId]->modRenderProfile;
|
return mod->modRenderProfile;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
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