diff options
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/resourcemanager.cpp | 7 | ||||
-rw-r--r-- | src/resources/resourcemanager.h | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index 82029adf..d185b99a 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -118,6 +118,13 @@ bool ResourceManager::isDirectory(const std::string &path) return PHYSFS_isDirectory(path.c_str()); } +std::string ResourceManager::getRealPath(const std::string &path) +{ + const char *dirSep = PHYSFS_getDirSeparator(); + + return std::string(PHYSFS_getRealDir(path.c_str())) + dirSep + path; +} + Resource* ResourceManager::get(const E_RESOURCE_TYPE &type, const std::string &idPath) { diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h index 9db8ccce..fa7d9610 100644 --- a/src/resources/resourcemanager.h +++ b/src/resources/resourcemanager.h @@ -96,6 +96,11 @@ class ResourceManager bool isDirectory(const std::string &path); /** + * Returns the real path to the given path in the PhysFS search path + */ + std::string getRealPath(const std::string &path); + + /** * Creates a resource and adds it to the resource map. The idPath is * converted into the appropriate path for the current operating system * and the resource is loaded. |