summaryrefslogtreecommitdiff
path: root/src/map/map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/map.cpp')
-rw-r--r--src/map/map.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/map/map.cpp b/src/map/map.cpp
index 79a26305e4..4a16ac417a 100644
--- a/src/map/map.cpp
+++ b/src/map/map.cpp
@@ -20,6 +20,7 @@ Map::Map(View& view)
texturepool(),
style(),
glyphAtlas(1024, 1024),
+ spriteAtlas(512, 512),
painter(*this),
loop(uv_loop_new()) {
@@ -175,7 +176,16 @@ void Map::resize(uint16_t width, uint16_t height, float ratio) {
}
void Map::resize(uint16_t width, uint16_t height, float ratio, uint16_t fb_width, uint16_t fb_height) {
+ bool changed = false;
+
if (transform.resize(width, height, ratio, fb_width, fb_height)) {
+ changed = true;
+ }
+ if (spriteAtlas.resize(ratio)) {
+ changed = true;
+ }
+
+ if (changed) {
update();
}
}
@@ -393,6 +403,11 @@ void Map::prepare() {
style.sprite->load(kSpriteURL);
}
+ // Allow the sprite atlas to potentially pull new sprite images if needed.
+ if (style.sprite && style.sprite->isLoaded()) {
+ spriteAtlas.update(*style.sprite);
+ }
+
updateTiles();
updateClippingIDs();