diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/map/map.cpp | 12 | ||||
-rw-r--r-- | src/map/tile_parser.cpp | 7 |
2 files changed, 8 insertions, 11 deletions
diff --git a/src/map/map.cpp b/src/map/map.cpp index e3aca9ee62..f9976b4e14 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -42,12 +42,11 @@ Map::Map(View& view_) #endif transform(view_), glyphAtlas(1024, 1024), - spriteAtlas(std::make_shared<SpriteAtlas>(512, 512)), + spriteAtlas(512, 512), texturepool(std::make_shared<Texturepool>()), - painter(*spriteAtlas, glyphAtlas) { - + painter(spriteAtlas, glyphAtlas) +{ view.initialize(this); - // Make sure that we're doing an initial drawing in all cases. is_clean.clear(); is_rendered.clear(); @@ -62,7 +61,6 @@ Map::~Map() { // Explicitly reset all pointers. texturepool.reset(); sprite.reset(); - spriteAtlas.reset(); glyphStore.reset(); style.reset(); fileSource.reset(); @@ -635,8 +633,8 @@ void Map::prepare() { style->updateProperties(state.getNormalizedZoom(), animationTime); // Allow the sprite atlas to potentially pull new sprite images if needed. - spriteAtlas->resize(state.getPixelRatio()); - spriteAtlas->setSprite(getSprite()); + spriteAtlas.resize(state.getPixelRatio()); + spriteAtlas.setSprite(getSprite()); updateTiles(); } diff --git a/src/map/tile_parser.cpp b/src/map/tile_parser.cpp index 190ecbe0d9..72f97096a0 100644 --- a/src/map/tile_parser.cpp +++ b/src/map/tile_parser.cpp @@ -39,9 +39,9 @@ TileParser::~TileParser() = default; TileParser::TileParser(const std::string &data, VectorTileData &tile_, const util::ptr<const Style> &style_, - GlyphAtlas& glyphAtlas_, + GlyphAtlas & glyphAtlas_, const util::ptr<GlyphStore> &glyphStore_, - const util::ptr<SpriteAtlas> &spriteAtlas_, + SpriteAtlas & spriteAtlas_, const util::ptr<Sprite> &sprite_) : vector_data(pbf((const uint8_t *)data.data(), data.size())), tile(tile_), @@ -54,7 +54,6 @@ TileParser::TileParser(const std::string &data, VectorTileData &tile_, assert(&tile != nullptr); assert(style); assert(glyphStore); - assert(spriteAtlas); assert(sprite); assert(collision); } @@ -176,7 +175,7 @@ std::unique_ptr<Bucket> TileParser::createLineBucket(const VectorTileLayer& laye std::unique_ptr<Bucket> TileParser::createSymbolBucket(const VectorTileLayer& layer, const FilterExpression &filter, const StyleBucketSymbol &symbol) { std::unique_ptr<SymbolBucket> bucket = std::make_unique<SymbolBucket>(symbol, *collision); - bucket->addFeatures(layer, filter, tile.id, *spriteAtlas, *sprite, glyphAtlas, *glyphStore); + bucket->addFeatures(layer, filter, tile.id, spriteAtlas, *sprite, glyphAtlas, *glyphStore); return obsolete() ? nullptr : std::move(bucket); } |