Skip to content

Commit

Permalink
UPBGE: Fix batching uvs and colors.
Browse files Browse the repository at this point in the history
The uvs and colors were merged at the wrong place (begining of the vector)
before.
  • Loading branch information
panzergame committed Oct 21, 2018
1 parent 5ac1856 commit ea1ffff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/gameengine/Rasterizer/RAS_BatchDisplayArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ unsigned int RAS_BatchDisplayArray::Merge(RAS_DisplayArray *array, const mt::mat
}

for (unsigned short i = 0; i < m_format.uvSize; ++i) {
m_vertexData.uvs[i].insert(m_vertexData.uvs[i].begin(), array->m_vertexData.uvs[i].begin(), array->m_vertexData.uvs[i].end());
m_vertexData.uvs[i].insert(m_vertexData.uvs[i].end(), array->m_vertexData.uvs[i].begin(), array->m_vertexData.uvs[i].end());
}

for (unsigned short i = 0; i < m_format.colorSize; ++i) {
m_vertexData.colors[i].insert(m_vertexData.colors[i].begin(), array->m_vertexData.colors[i].begin(), array->m_vertexData.colors[i].end());
m_vertexData.colors[i].insert(m_vertexData.colors[i].end(), array->m_vertexData.colors[i].begin(), array->m_vertexData.colors[i].end());
}

// Copy the indices of the merged array with as gap the first vertex index.
Expand Down

0 comments on commit ea1ffff

Please sign in to comment.