[core] 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 24285926c2
commit 177372b836
4 changed files with 31 additions and 22 deletions

View File

@@ -527,9 +527,14 @@ bool Source::update(MapData& data,
}
void Source::updateTilePtrs() {
tilePtrs.clear();
std::vector<Tile*> newPtrs;
for (const auto& pair : tiles) {
tilePtrs.push_back(pair.second.get());
newPtrs.push_back(pair.second.get());
}
if (tilePtrs != newPtrs) {
tilePtrs.swap(newPtrs);
emitTileLoaded(true);
}
}