diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-05-26 19:35:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-05-26 19:35:24 +0300 |
commit | 6ed4f7f09a297e9afb829634399c94ccc542729e (patch) | |
tree | b80aec2b7164f46445d154c9a3e29e05ab7d0f99 /src/resources/resourcemanager | |
parent | 5663e39eba8979228e252d76fba676586c4f862f (diff) | |
download | manaverse-6ed4f7f09a297e9afb829634399c94ccc542729e.tar.gz manaverse-6ed4f7f09a297e9afb829634399c94ccc542729e.tar.bz2 manaverse-6ed4f7f09a297e9afb829634399c94ccc542729e.tar.xz manaverse-6ed4f7f09a297e9afb829634399c94ccc542729e.zip |
Move walk layer load function from resourcemanager into separate file.
Diffstat (limited to 'src/resources/resourcemanager')
-rw-r--r-- | src/resources/resourcemanager/resourcemanager.cpp | 37 | ||||
-rw-r--r-- | src/resources/resourcemanager/resourcemanager.h | 2 |
2 files changed, 0 insertions, 39 deletions
diff --git a/src/resources/resourcemanager/resourcemanager.cpp b/src/resources/resourcemanager/resourcemanager.cpp index e4a540fc3..dd652c22b 100644 --- a/src/resources/resourcemanager/resourcemanager.cpp +++ b/src/resources/resourcemanager/resourcemanager.cpp @@ -527,43 +527,6 @@ Resource *ResourceManager::get(const std::string &idPath, return resource; } -#ifndef DYECMD -struct WalkLayerLoader final -{ - const std::string name; - Map *map; - - static Resource *load(const void *const v) - { - if (!v) - return nullptr; - - const WalkLayerLoader *const rl = static_cast<const - WalkLayerLoader *const>(v); - Resource *const resource = NavigationManager::loadWalkLayer(rl->map); - if (!resource) - reportAlways("WalkLayer creation error"); - return resource; - } -}; -#endif - -#ifndef DYECMD -WalkLayer *ResourceManager::getWalkLayer(const std::string &name, - Map *const map) -{ - WalkLayerLoader rl = {name, map}; - return static_cast<WalkLayer*>(get("map_" + name, - WalkLayerLoader::load, &rl)); -} -#else -WalkLayer *ResourceManager::getWalkLayer(const std::string &name A_UNUSED, - Map *const map A_UNUSED) -{ - return nullptr; -} -#endif - struct SpriteDefLoader final { std::string path; diff --git a/src/resources/resourcemanager/resourcemanager.h b/src/resources/resourcemanager/resourcemanager.h index f0e184825..582359079 100644 --- a/src/resources/resourcemanager/resourcemanager.h +++ b/src/resources/resourcemanager/resourcemanager.h @@ -133,8 +133,6 @@ class ResourceManager final : public MemoryCounter */ bool addResource(const std::string &idPath, Resource *const resource); - WalkLayer *getWalkLayer(const std::string &name, Map *const map); - /** * Creates a sprite definition based on a given path and the supplied * variant. |