[core] Map::setSprite ⇢ Map::addAnnotationIcon

Fixes #3084
This commit is contained in:
John Firebaugh
2015-12-01 13:39:15 -08:00
parent 8a66b7047f
commit 8afa14fa78
12 changed files with 44 additions and 50 deletions

View File

@@ -267,9 +267,14 @@ bool MapContext::isLoaded() const {
return style->isLoaded();
}
double MapContext::getTopOffsetPixelsForAnnotationSymbol(const std::string& symbol) {
void MapContext::addAnnotationIcon(const std::string& name, std::shared_ptr<const SpriteImage> sprite) {
assert(util::ThreadContext::currentlyOn(util::ThreadType::Map));
return data.getAnnotationManager()->getTopOffsetPixelsForAnnotationSymbol(symbol);
data.getAnnotationManager()->addIcon(name, sprite);
}
double MapContext::getTopOffsetPixelsForAnnotationIcon(const std::string& name) {
assert(util::ThreadContext::currentlyOn(util::ThreadType::Map));
return data.getAnnotationManager()->getTopOffsetPixelsForIcon(name);
}
void MapContext::setSourceTileCacheSize(size_t size) {
@@ -289,11 +294,6 @@ void MapContext::onLowMemory() {
asyncInvalidate.send();
}
void MapContext::setSprite(const std::string& name, std::shared_ptr<const SpriteImage> sprite) {
assert(util::ThreadContext::currentlyOn(util::ThreadType::Map));
data.getAnnotationManager()->setSprite(name, sprite);
}
void MapContext::onTileDataChanged() {
assert(util::ThreadContext::currentlyOn(util::ThreadType::Map));
updateFlags |= Update::Repaint;