only update the render order array when there are changes to tiles

This commit is contained in:
Konstantin Käfer
2015-08-20 15:34:32 -04:00
parent 038b65eded
commit fd98607c5f
4 changed files with 27 additions and 21 deletions

View File

@@ -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();
}