mirror of https://github.com/axmolengine/axmol.git
Merge pull request #8082 from dabingnn/v3_fixFastTMXIntIndices
change indices to short for fast tmx
This commit is contained in:
commit
38810eeb2e
|
@ -300,7 +300,7 @@ void TMXLayer::updateIndexBuffer()
|
||||||
{
|
{
|
||||||
if(nullptr == _indexBuffer)
|
if(nullptr == _indexBuffer)
|
||||||
{
|
{
|
||||||
_indexBuffer = IndexBuffer::create(IndexBuffer::IndexType::INDEX_TYPE_UINT_32, (int)_indices.size());
|
_indexBuffer = IndexBuffer::create(IndexBuffer::IndexType::INDEX_TYPE_SHORT_16, (int)_indices.size());
|
||||||
CC_SAFE_RETAIN(_indexBuffer);
|
CC_SAFE_RETAIN(_indexBuffer);
|
||||||
}
|
}
|
||||||
_indexBuffer->updateIndices(&_indices[0], (int)_indices.size(), 0);
|
_indexBuffer->updateIndices(&_indices[0], (int)_indices.size(), 0);
|
||||||
|
|
|
@ -241,7 +241,7 @@ protected:
|
||||||
bool _quadsDirty;
|
bool _quadsDirty;
|
||||||
std::vector<int> _tileToQuadIndex;
|
std::vector<int> _tileToQuadIndex;
|
||||||
std::vector<V3F_C4B_T2F_Quad> _totalQuads;
|
std::vector<V3F_C4B_T2F_Quad> _totalQuads;
|
||||||
std::vector<int> _indices;
|
std::vector<GLushort> _indices;
|
||||||
std::map<int/*vertexZ*/, int/*offset to _indices by quads*/> _indicesVertexZOffsets;
|
std::map<int/*vertexZ*/, int/*offset to _indices by quads*/> _indicesVertexZOffsets;
|
||||||
std::unordered_map<int/*vertexZ*/, int/*number to quads*/> _indicesVertexZNumber;
|
std::unordered_map<int/*vertexZ*/, int/*number to quads*/> _indicesVertexZNumber;
|
||||||
std::vector<PrimitiveCommand> _renderCommands;
|
std::vector<PrimitiveCommand> _renderCommands;
|
||||||
|
|
Loading…
Reference in New Issue