about summary refs log tree commit diff
path: root/src/engine
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2012-11-13 21:37:46 +0100
committeroy <Tom_Adams@web.de>2013-02-24 18:29:41 +0100
commit73386fdf0f23563e1c4a92857810f8103407fd6b (patch)
tree398523e4543c84bb986f253fa6f03547b7e8dab7 /src/engine
parent68390fe04afce9767b152eadaefd9a3bc8462854 (diff)
downloadzcatch-73386fdf0f23563e1c4a92857810f8103407fd6b.tar.gz
zcatch-73386fdf0f23563e1c4a92857810f8103407fd6b.zip
fixed last commit
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/client/graphics_threaded.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/engine/client/graphics_threaded.cpp b/src/engine/client/graphics_threaded.cpp
index 50a116b4..0357c41a 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)