summaryrefslogtreecommitdiff
path: root/src/resources/resourcemanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/resourcemanager.cpp')
-rw-r--r--src/resources/resourcemanager.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp
index 9a4d1c3f1..43092e28d 100644
--- a/src/resources/resourcemanager.cpp
+++ b/src/resources/resourcemanager.cpp
@@ -26,6 +26,9 @@
#include "client.h"
#include "configuration.h"
#include "logger.h"
+#include "map.h"
+#include "navigationmanager.h"
+#include "walklayer.h"
#include "resources/atlasmanager.h"
#include "resources/dye.h"
@@ -740,6 +743,31 @@ Resource *ResourceManager::getAtlas(const std::string &name,
}
#endif
+struct WalkLayerLoader
+{
+ 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);
+ return resource;
+ }
+};
+
+WalkLayer *ResourceManager::getWalkLayer(const std::string &name,
+ Map *const map)
+{
+ WalkLayerLoader rl = {name, map};
+ return static_cast<WalkLayer*>(get("map_" + name,
+ WalkLayerLoader::load, &rl));
+}
+
struct SpriteDefLoader
{
std::string path;