[core] Split style image collection from SpriteAtlas

This commit is contained in:
Ivo van Dongen
2017-05-12 23:19:00 +03:00
committed by John Firebaugh
parent c80f3e9d29
commit cc9f040a2d
33 changed files with 677 additions and 413 deletions

View File

@@ -942,8 +942,7 @@ void Map::addImage(const std::string& id, std::unique_ptr<style::Image> image) {
}
impl->styleMutated = true;
impl->style->spriteAtlas->addImage(id, std::move(image));
impl->onUpdate(Update::Repaint);
impl->style->addImage(id, std::move(image));
}
void Map::removeImage(const std::string& id) {
@@ -952,13 +951,12 @@ void Map::removeImage(const std::string& id) {
}
impl->styleMutated = true;
impl->style->spriteAtlas->removeImage(id);
impl->onUpdate(Update::Repaint);
impl->style->removeImage(id);
}
const style::Image* Map::getImage(const std::string& id) {
if (impl->style) {
return impl->style->spriteAtlas->getImage(id);
return impl->style->getImage(id);
}
return nullptr;
}