# HG changeset patch # User prock@33b003aa-7bff-0310-803a-e67f0ece8222 # Date 1264283631 0 # Node ID a3a044c586abbab3b58c7040c0a57bb8f546f06e # Parent 605d13efc6f9e2b9ca3746ce723352827894b5d5 Removed the filename lower case transformations. OSX 10.6 is not case sensitive so I was unable to test fully. diff -r 605d13efc6f9 -r a3a044c586ab engine/core/vfs/vfs.cpp --- a/engine/core/vfs/vfs.cpp Sat Jan 23 00:18:54 2010 +0000 +++ b/engine/core/vfs/vfs.cpp Sat Jan 23 21:53:51 2010 +0000 @@ -117,11 +117,10 @@ } VFSSource* VFS::getSourceForFile(const std::string& file) const { - std::string lowerpath = lower(file); type_sources::const_iterator i = std::find_if(m_sources.begin(), m_sources.end(), - boost::bind2nd(boost::mem_fun(&VFSSource::fileExists), lowerpath)); + boost::bind2nd(boost::mem_fun(&VFSSource::fileExists), file)); if (i == m_sources.end()) { - FL_WARN(_log, LMsg("no source for ") << lowerpath << " found"); + FL_WARN(_log, LMsg("no source for ") << file << " found"); return 0; } @@ -129,7 +128,7 @@ } bool VFS::exists(const std::string& file) const { - return getSourceForFile(lower(file)); + return getSourceForFile(file); } bool VFS::isDirectory(const std::string& path) const { @@ -155,40 +154,20 @@ } RawData* VFS::open(const std::string& path) { - std::string lowerpath = lower(path); - FL_DBG(_log, LMsg("Opening: ") << lowerpath); + FL_DBG(_log, LMsg("Opening: ") << path); - VFSSource* source = getSourceForFile(lowerpath); + VFSSource* source = getSourceForFile(path); if (!source) throw NotFound(path); - return source->open(lowerpath); - } - - std::string VFS::lower(const std::string& str) const { - std::string result; - result.resize(str.size()); - bool found_uppercase = false; - for(unsigned i=0; i != str.size(); ++i) - { - result[i] = tolower(str[i]); - found_uppercase |= result[i] != str[i]; - } - if( found_uppercase ) - { - FL_WARN(_log, LMsg("Case mismatch: given '") << str - << "', FIFE will use '" << result - << "' - Please only use lower case filenames to avoid problems with different file systems."); - } - return result; + return source->open(path); } std::set VFS::listFiles(const std::string& pathstr) const { - std::string lowerpath = lower(pathstr); std::set list; type_sources::const_iterator end = m_sources.end(); for (type_sources::const_iterator i = m_sources.begin(); i != end; ++i) { - std::set sourcelist = (*i)->listFiles(lowerpath); + std::set sourcelist = (*i)->listFiles(pathstr); list.insert(sourcelist.begin(), sourcelist.end()); } @@ -196,17 +175,15 @@ } std::set VFS::listFiles(const std::string& path, const std::string& filterregex) const { - std::string lowerpath = lower(path); - std::set list = listFiles(lowerpath); + std::set list = listFiles(path); return filterList(list, filterregex); } std::set VFS::listDirectories(const std::string& pathstr) const { - std::string lowerpath = lower(pathstr); std::set list; type_sources::const_iterator end = m_sources.end(); for (type_sources::const_iterator i = m_sources.begin(); i != end; ++i) { - std::set sourcelist = (*i)->listDirectories(lowerpath); + std::set sourcelist = (*i)->listDirectories(pathstr); list.insert(sourcelist.begin(), sourcelist.end()); } @@ -214,7 +191,7 @@ } std::set VFS::listDirectories(const std::string& path, const std::string& filterregex) const { - std::set list = listDirectories(lower(path)); + std::set list = listDirectories(path); return filterList(list, filterregex); } diff -r 605d13efc6f9 -r a3a044c586ab engine/core/vfs/vfs.h --- a/engine/core/vfs/vfs.h Sat Jan 23 00:18:54 2010 +0000 +++ b/engine/core/vfs/vfs.h Sat Jan 23 21:53:51 2010 +0000 @@ -160,7 +160,6 @@ mutable type_usedfiles m_usedfiles; std::set filterList(const std::set& list, const std::string& fregex) const; - std::string lower(const std::string&) const; VFSSource* getSourceForFile(const std::string& file) const; }; diff -r 605d13efc6f9 -r a3a044c586ab engine/core/vfs/vfsdirectory.cpp --- a/engine/core/vfs/vfsdirectory.cpp Sat Jan 23 00:18:54 2010 +0000 +++ b/engine/core/vfs/vfsdirectory.cpp Sat Jan 23 21:53:51 2010 +0000 @@ -41,7 +41,7 @@ static Logger _log(LM_VFS); VFSDirectory::VFSDirectory(VFS* vfs, const std::string& root) : VFSSource(vfs), m_root(root) { - std::transform(m_root.begin(), m_root.end(), m_root.begin(), tolower); + //std::transform(m_root.begin(), m_root.end(), m_root.begin(), tolower); FL_DBG(_log, LMsg("VFSDirectory created with root path ") << m_root); if(!m_root.empty() && *(m_root.end() - 1) != '/') m_root.append(1,'/');