summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-03-21 12:47:06 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-03-21 21:15:42 +0100
commit44df7c0ebfef37e78be75407f490c1bb1ffb03b4 (patch)
treeac78b31fb8fbef2e5d95dc6b42c8046e6bf8d30c /src/resources
parent9f8cf8cf3031a0bb314779ab3c9d22fc87d6c306 (diff)
downloadmana-44df7c0ebfef37e78be75407f490c1bb1ffb03b4.tar.gz
mana-44df7c0ebfef37e78be75407f490c1bb1ffb03b4.tar.bz2
mana-44df7c0ebfef37e78be75407f490c1bb1ffb03b4.tar.xz
mana-44df7c0ebfef37e78be75407f490c1bb1ffb03b4.zip
Removed unused ResourceManager methods
* ResourceManager::addResource * ResourceManager::get(const std::string &) These were once added in 32996cee607c52ecef9be4638df554dd89b39c24, but they are no longer necessary after the port to SDL2 (2c51c98625b225cecfb9628c30d62d4e30f7e3e1).
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/resourcemanager.cpp24
-rw-r--r--src/resources/resourcemanager.h19
2 files changed, 0 insertions, 43 deletions
diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp
index e215cfd7..e2979f06 100644
--- a/src/resources/resourcemanager.cpp
+++ b/src/resources/resourcemanager.cpp
@@ -230,30 +230,6 @@ std::string ResourceManager::getPath(const std::string &file)
return path;
}
-bool ResourceManager::addResource(const std::string &idPath,
- Resource *resource)
-{
- if (resource)
- {
- resource->incRef();
- resource->mIdPath = idPath;
- mResources[idPath] = resource;
- return true;
- }
- return false;
-}
-
-Resource *ResourceManager::get(const std::string &idPath)
-{
- auto resIter = mResources.find(idPath);
- if (resIter != mResources.end())
- {
- resIter->second->incRef();
- return resIter->second;
- }
- return nullptr;
-}
-
Resource *ResourceManager::get(const std::string &idPath,
const std::function<Resource *()> &generator)
{
diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h
index b207585f..7a92818f 100644
--- a/src/resources/resourcemanager.h
+++ b/src/resources/resourcemanager.h
@@ -105,16 +105,6 @@ class ResourceManager
std::string getPath(const std::string &file);
/**
- * Returns the resource with the specified idPath, or 0 when no such
- * resource is available. Increments the reference count.
- *
- * @param idPath The resource identifier path.
- * @return A valid resource or <code>NULL</code> if the resource could
- * not be found.
- */
- Resource *get(const std::string &idPath);
-
- /**
* Creates a resource and adds it to the resource map.
*
* @param idPath The resource identifier path.
@@ -137,15 +127,6 @@ class ResourceManager
Resource *load(const std::string &path, loader fun);
/**
- * Adds a preformatted resource to the resource map.
- *
- * @param idPath The resource identifier path.
- * @param resource The Resource to add.
- * @return true if successful, false otherwise.
- */
- bool addResource(const std::string &idPath, Resource *resource);
-
- /**
* Copies a file from one place to another (useful for extracting
* raw files from a zip archive, for example)
*