From da05d9dd98315378bdded216184294f376643191 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 22 Aug 2015 14:14:34 +0300 Subject: Use resource manager as global variable. --- src/resources/map/map.cpp | 8 ++++---- src/resources/map/mapitem.cpp | 7 +------ 2 files changed, 5 insertions(+), 10 deletions(-) (limited to 'src/resources/map') diff --git a/src/resources/map/map.cpp b/src/resources/map/map.cpp index b96abc7d2..cc2d3487a 100644 --- a/src/resources/map/map.cpp +++ b/src/resources/map/map.cpp @@ -222,8 +222,6 @@ void Map::optionChanged(const std::string &value) void Map::initializeAmbientLayers() { - ResourceManager *const resman = ResourceManager::getInstance(); - // search for "foreground*" or "overlay*" (old term) in map properties for (int i = 0; /* terminated by a break */; i++) { @@ -243,7 +241,8 @@ void Map::initializeAmbientLayers() break; // the FOR loop } - Image *const img = resman->getImage(getProperty(name + "image")); + Image *const img = resourceManager->getImage( + getProperty(name + "image")); if (img) { int mask = atoi(getProperty(name + "mask").c_str()); @@ -270,7 +269,8 @@ void Map::initializeAmbientLayers() toString(i)).append("image")); i ++) { const std::string name("background" + toString(i)); - Image *const img = resman->getImage(getProperty(name + "image")); + Image *const img = resourceManager->getImage( + getProperty(name + "image")); if (img) { diff --git a/src/resources/map/mapitem.cpp b/src/resources/map/mapitem.cpp index 44f3ec889..ae45a0efb 100644 --- a/src/resources/map/mapitem.cpp +++ b/src/resources/map/mapitem.cpp @@ -114,14 +114,9 @@ void MapItem::setType(const int type) } if (!name.empty()) - { - ResourceManager *const resman = ResourceManager::getInstance(); - mImage = resman->getImage(name); - } + mImage = resourceManager->getImage(name); else - { mImage = nullptr; - } } void MapItem::setPos(const int x, const int y) -- cgit v1.2.3-60-g2f50