From 44df7c0ebfef37e78be75407f490c1bb1ffb03b4 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Thu, 21 Mar 2024 12:47:06 +0100 Subject: 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). --- src/resources/resourcemanager.cpp | 24 ------------------------ src/resources/resourcemanager.h | 19 ------------------- 2 files changed, 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 &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 @@ -104,16 +104,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 NULL if the resource could - * not be found. - */ - Resource *get(const std::string &idPath); - /** * Creates a resource and adds it to the resource map. * @@ -136,15 +126,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) -- cgit v1.2.3-70-g09d2