diff options
Diffstat (limited to 'src/map.cpp')
-rw-r--r-- | src/map.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/map.cpp b/src/map.cpp index 77f9feb8..e9d29b61 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -243,7 +243,7 @@ void Map::initializeAmbientLayers() auto addAmbientLayer = [=](const std::string &name, std::vector<AmbientLayer> &list) { - if (Image *img = resman->getImage(getProperty(name + "image"))) + if (auto img = resman->getImageRef(getProperty(name + "image"))) { auto &ambientLayer = list.emplace_back(img); ambientLayer.mParallax = getFloatProperty(name + "parallax"); @@ -251,9 +251,6 @@ void Map::initializeAmbientLayers() ambientLayer.mSpeedY = getFloatProperty(name + "scrollY"); ambientLayer.mMask = getIntProperty(name + "mask", 1); ambientLayer.mKeepRatio = getBoolProperty(name + "keepratio"); - - // The AmbientLayer takes control over the image. - img->decRef(); } }; |