only update the render order array when there are changes to tiles
This commit is contained in:
@@ -334,6 +334,7 @@ bool MapContext::renderSync(const TransformState& state, const FrameData& frame)
|
||||
if (!painter) {
|
||||
painter = std::make_unique<Painter>(data);
|
||||
painter->setup();
|
||||
painter->updateRenderOrder(*style);
|
||||
}
|
||||
|
||||
painter->setDebug(data.getDebug());
|
||||
@@ -400,6 +401,10 @@ void MapContext::setSprite(const std::string& name, std::shared_ptr<const Sprite
|
||||
void MapContext::onTileDataChanged() {
|
||||
assert(util::ThreadContext::currentlyOn(util::ThreadType::Map));
|
||||
|
||||
if (painter) {
|
||||
painter->updateRenderOrder(*style);
|
||||
}
|
||||
|
||||
updateFlags |= Update::Repaint;
|
||||
asyncUpdate->send();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user