From a7574f75d2389997091fa4c5356feb5dff1e0075 Mon Sep 17 00:00:00 2001 From: oy Date: Tue, 13 Nov 2012 21:37:46 +0100 Subject: [PATCH] fixed last commit --- src/engine/client/graphics_threaded.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/engine/client/graphics_threaded.cpp b/src/engine/client/graphics_threaded.cpp index b5d87f8bd..8a709557e 100644 --- a/src/engine/client/graphics_threaded.cpp +++ b/src/engine/client/graphics_threaded.cpp @@ -80,13 +80,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)) { @@ -94,6 +99,8 @@ void CGraphics_Threaded::FlushVertices() return; } } + + mem_copy(Cmd.m_pVertices, m_aVertices, sizeof(CCommandBuffer::SVertex)*NumVerts); } void CGraphics_Threaded::AddVertices(int Count)