mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-09-09 14:22:58 +02:00
Small round of patches for various issues, #2.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5831 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
@@ -2300,19 +2300,27 @@ void GSState::GrowVertexBuffer()
|
||||
GSVertex* vertex = (GSVertex*)_aligned_malloc(sizeof(GSVertex) * maxcount, 32);
|
||||
uint32* index = (uint32*)_aligned_malloc(sizeof(uint32) * maxcount * 3, 32); // worst case is slightly less than vertex number * 3
|
||||
|
||||
if(m_vertex.buff != NULL)
|
||||
if (m_vertex.buff != NULL && vertex != NULL)
|
||||
{
|
||||
memcpy(vertex, m_vertex.buff, sizeof(GSVertex) * m_vertex.tail);
|
||||
|
||||
_aligned_free(m_vertex.buff);
|
||||
}
|
||||
else // very bad!
|
||||
{
|
||||
printf("GSdx: failed to allocate %d bytes for verticles.\n", sizeof(GSVertex) * maxcount);
|
||||
}
|
||||
|
||||
if(m_index.buff != NULL)
|
||||
if (m_index.buff != NULL && index != NULL)
|
||||
{
|
||||
memcpy(index, m_index.buff, sizeof(uint32) * m_index.tail);
|
||||
|
||||
_aligned_free(m_index.buff);
|
||||
}
|
||||
else // very bad!
|
||||
{
|
||||
printf("GSdx: failed to allocate %d bytes for indices.\n", sizeof(uint32) * maxcount * 3);
|
||||
}
|
||||
|
||||
m_vertex.buff = vertex;
|
||||
m_vertex.maxcount = maxcount - 3; // -3 to have some space at the end of the buffer before DrawingKick can grow it
|
||||
|
||||
Reference in New Issue
Block a user