diff --git a/cocos/2d/CCFastTMXLayer.cpp b/cocos/2d/CCFastTMXLayer.cpp index 24ee91f1e7..fc4d7dc29b 100644 --- a/cocos/2d/CCFastTMXLayer.cpp +++ b/cocos/2d/CCFastTMXLayer.cpp @@ -300,7 +300,7 @@ void TMXLayer::updateIndexBuffer() { 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); } _indexBuffer->updateIndices(&_indices[0], (int)_indices.size(), 0); diff --git a/cocos/2d/CCFastTMXLayer.h b/cocos/2d/CCFastTMXLayer.h index 14a984d598..d50a0132f0 100644 --- a/cocos/2d/CCFastTMXLayer.h +++ b/cocos/2d/CCFastTMXLayer.h @@ -241,7 +241,7 @@ protected: bool _quadsDirty; std::vector _tileToQuadIndex; std::vector _totalQuads; - std::vector _indices; + std::vector _indices; std::map _indicesVertexZOffsets; std::unordered_map _indicesVertexZNumber; std::vector _renderCommands;