From 9eed8feb838c31368dba6cd9716f67d800bf6e3b Mon Sep 17 00:00:00 2001 From: Björn Steinbrink Date: Thu, 4 Aug 2005 21:19:25 +0000 Subject: Added a method to the resource mananger to determine the real path of a file in the search path. Added a first user of that function. Minor cleanup. --- src/resources/resourcemanager.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/resources/resourcemanager.cpp') 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) { -- cgit v1.2.3-70-g09d2