fixed last commit

This commit is contained in:
oy 2012-11-13 21:37:46 +01:00
parent 591b6a2f62
commit 090867fa0d

View file

@ -71,13 +71,18 @@ void CGraphics_Threaded::FlushVertices()
}
}
mem_copy(Cmd.m_pVertices, m_aVertices, sizeof(CCommandBuffer::SVertex)*NumVerts);
// check if we have enough free memory in the commandbuffer
if(!m_pCommandBuffer->AddCommand(Cmd))
{
// kick command buffer and try again
KickCommandBuffer();
Cmd.m_pVertices = (CCommandBuffer::SVertex *)m_pCommandBuffer->AllocData(sizeof(CCommandBuffer::SVertex)*NumVerts);
if(Cmd.m_pVertices == 0x0)
{
dbg_msg("graphics", "failed to allocate data for vertices");
return;
}
if(!m_pCommandBuffer->AddCommand(Cmd))
{
@ -85,6 +90,8 @@ void CGraphics_Threaded::FlushVertices()
return;
}
}
mem_copy(Cmd.m_pVertices, m_aVertices, sizeof(CCommandBuffer::SVertex)*NumVerts);
}
void CGraphics_Threaded::AddVertices(int Count)