Inline Source::updateTiles()

This commit is contained in:
John Firebaugh
2014-11-26 16:01:15 -08:00
parent 78f11ae947
commit 12bf2fd326
2 changed files with 10 additions and 32 deletions

View File

@@ -35,7 +35,7 @@ public:
Source(SourceInfo&);
void load(Map&, FileSource&);
bool update(Map&, uv::worker&,
void update(Map&, uv::worker&,
util::ptr<Style>,
GlyphAtlas&, GlyphStore&,
SpriteAtlas&, util::ptr<Sprite>,
@@ -59,13 +59,6 @@ private:
int32_t coveringZoomLevel(const TransformState&) const;
std::forward_list<Tile::ID> coveringTiles(const TransformState&) const;
bool updateTiles(Map&, uv::worker&,
util::ptr<Style>,
GlyphAtlas&, GlyphStore&,
SpriteAtlas&, util::ptr<Sprite>,
Texturepool&, FileSource&,
std::function<void ()> callback);
TileData::State addTile(Map&, uv::worker&,
util::ptr<Style>,
GlyphAtlas&, GlyphStore&,

View File

@@ -61,23 +61,6 @@ void Source::load(Map& map, FileSource& fileSource) {
});
}
bool Source::update(Map& map, uv::worker& worker,
util::ptr<Style> style,
GlyphAtlas& glyphAtlas, GlyphStore& glyphStore,
SpriteAtlas& spriteAtlas, util::ptr<Sprite> sprite,
Texturepool& texturepool, FileSource& fileSource,
std::function<void ()> callback) {
if (loaded && map.getTime() > updated) {
return updateTiles(map, worker, style,
glyphAtlas, glyphStore,
spriteAtlas, sprite,
texturepool, fileSource,
callback);
} else {
return false;
}
}
void Source::updateClipIDs(const std::map<Tile::ID, ClipID> &mapping) {
std::for_each(tiles.begin(), tiles.end(), [&mapping](std::pair<const Tile::ID, std::unique_ptr<Tile>> &pair) {
Tile &tile = *pair.second;
@@ -299,11 +282,15 @@ bool Source::findLoadedParent(const Tile::ID& id, int32_t minCoveringZoom, std::
return false;
}
bool Source::updateTiles(Map& map, uv::worker& worker, util::ptr<Style> style,
GlyphAtlas& glyphAtlas, GlyphStore& glyphStore,
SpriteAtlas& spriteAtlas, util::ptr<Sprite> sprite,
Texturepool& texturepool, FileSource& fileSource,
std::function<void ()> callback) {
void Source::update(Map& map, uv::worker& worker,
util::ptr<Style> style,
GlyphAtlas& glyphAtlas, GlyphStore& glyphStore,
SpriteAtlas& spriteAtlas, util::ptr<Sprite> sprite,
Texturepool& texturepool, FileSource& fileSource,
std::function<void ()> callback) {
if (!loaded || map.getTime() <= updated)
return;
bool changed = false;
int32_t zoom = std::floor(getZoom(map.getState()));
@@ -377,8 +364,6 @@ bool Source::updateTiles(Map& map, uv::worker& worker, util::ptr<Style> style,
});
updated = map.getTime();
return changed;
}
}