mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Do not generate render data in case CDecal calculated wrong coordinates.
Tested By: OptimusShepard, Stan Differential Revision: https://code.wildfiregames.com/D3578 This was SVN commit r24932.
This commit is contained in:
@@ -234,6 +234,15 @@ void CDecalRData::BuildVertexData()
|
||||
|
||||
ssize_t i0, j0, i1, j1;
|
||||
m_Decal->CalcVertexExtents(i0, j0, i1, j1);
|
||||
// Currently CalcVertexExtents might return empty rectangle, that means
|
||||
// we can't render it.
|
||||
if (i1 <= i0 && j1 <= j0)
|
||||
{
|
||||
// We have nothing to render.
|
||||
m_VBDecals.Reset();
|
||||
m_VBDecalsIndices.Reset();
|
||||
return;
|
||||
}
|
||||
|
||||
CmpPtr<ICmpWaterManager> cmpWaterManager(*m_Simulation, SYSTEM_ENTITY);
|
||||
|
||||
@@ -300,8 +309,6 @@ void CDecalRData::BuildVertexData()
|
||||
}
|
||||
}
|
||||
|
||||
ENSURE(!indices.empty());
|
||||
|
||||
// Construct vertex buffer.
|
||||
if (!m_VBDecalsIndices || m_VBDecalsIndices->m_Count != indices.size())
|
||||
m_VBDecalsIndices = g_VBMan.AllocateChunk(sizeof(u16), indices.size(), GL_STATIC_DRAW, GL_ELEMENT_ARRAY_BUFFER);
|
||||
|
||||
Reference in New Issue
Block a user