[core] Split style image collection from SpriteAtlas
This commit is contained in:
committed by
John Firebaugh
parent
c80f3e9d29
commit
cc9f040a2d
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user