Skip to content

Commit e3438ed

Browse files
authored
fix flicker of fast tilemap (#20387)
1 parent 31510ee commit e3438ed

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

cocos/2d/CCFastTMXLayer.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,8 @@ FastTMXLayer::~FastTMXLayer()
130130
void FastTMXLayer::draw(Renderer *renderer, const Mat4& transform, uint32_t flags)
131131
{
132132
updateTotalQuads();
133-
134-
bool isViewProjectionUpdated = true;
135-
auto visitingCamera = Camera::getVisitingCamera();
136-
auto defaultCamera = Camera::getDefaultCamera();
137-
if (visitingCamera == defaultCamera) {
138-
isViewProjectionUpdated = visitingCamera->isViewProjectionUpdated();
139-
}
140133

141-
if( flags != 0 || _dirty || _quadsDirty || isViewProjectionUpdated)
134+
if( flags != 0 || _dirty || _quadsDirty)
142135
{
143136
Size s = Director::getInstance()->getVisibleSize();
144137
const Vec2 &anchor = getAnchorPoint();
@@ -284,7 +277,7 @@ void FastTMXLayer::updateIndexBuffer()
284277
if (!_indexBuffer)
285278
{
286279
auto device = backend::Device::getInstance();
287-
_indexBuffer = device->newBuffer(indexBufferSize, backend::BufferType::INDEX, backend::BufferUsage::STATIC);
280+
_indexBuffer = device->newBuffer(indexBufferSize, backend::BufferType::INDEX, backend::BufferUsage::DYNAMIC);
288281
}
289282
_indexBuffer->updateData(&_indices[0], indexBufferSize);
290283
}

0 commit comments

Comments
 (0)