Closed jcy1001 closed 1 year ago
Any example source plz?
FastTMXTiledMap pTiledmap=FastTMXTiledMap::create("TileMap/BattleMap/BattleMap2.tmx"); Layer layer = Layer::create(); layer->setPosition(_tileMap->getPosition()); layer->addChild(_tileMap, 0);
Size winSize = Director::getInstance()->getWinSize();
m_pScrollView = axis::extension::ScrollView::create(winSize,NULL);
m_pScrollView->setMinScale(MIN_SCALE);
m_pScrollView->setMaxScale(MAX_SCALE);
this->addChild(m_pScrollView,0);
just like this and
i found void FastTMXLayer::updateIndexBuffer() {
unsigned int indexBufferSize = (unsigned int)(sizeof(unsigned int) * _indices.size());
unsigned int indexBufferSize = (unsigned int)(sizeof(unsigned short) * _indices.size());
if (!_indexBuffer)
{
auto device = backend::Device::getInstance();
_indexBuffer = device->newBuffer(indexBufferSize, backend::BufferType::INDEX, backend::BufferUsage::DYNAMIC);
}
_indexBuffer->updateData(&_indices[0], indexBufferSize);
}
indexBufferSize is unsigned int ,may it cause this problem??
@jcy1001 without any source example (300*300 tiles) neverone can give an answer.
This is the same issue as #1306
300 x 300 tiles = 90,000 tiles, which is above the 16384 (128x128) tile limit in the TMX implementation.