forked from mirrors/0ad
refactor path interface:
- use wrapper class instead of std::wstring (reduces mixing of strings/paths; allows safe+easy join via operator/ and convenient case-insensitive comparison via operator==, avoids NativePathFromString, similar to boost::filesystem) - NativePath -> OsPath - add hash and To/FromJSVal for Path - add TS_ASSERT_PATH_EQUALS - replace _wfopen_s with sys_OpenFile - remove obsolete SortFiles/Directories This was SVN commit r9107.
This commit is contained in:
@@ -85,7 +85,7 @@ CObjectBase* CObjectManager::FindObjectBase(const CStrW& objectname)
|
||||
|
||||
CObjectBase* obj = new CObjectBase(*this);
|
||||
|
||||
VfsPath pathname = Path::Join("art/actors/", objectname);
|
||||
VfsPath pathname = VfsPath("art/actors/") / objectname;
|
||||
|
||||
if (obj->Load(pathname))
|
||||
{
|
||||
@@ -123,7 +123,7 @@ CObjectEntry* CObjectManager::FindObjectVariation(CObjectBase* base, const std::
|
||||
// Look to see whether this particular variation has already been loaded
|
||||
|
||||
std::vector<u8> choices = base->CalculateVariationKey(selections);
|
||||
ObjectKey key (base->m_Pathname, choices);
|
||||
ObjectKey key (base->m_Pathname.string(), choices);
|
||||
|
||||
std::map<ObjectKey, CObjectEntry*>::iterator it = m_Objects.find(key);
|
||||
if (it != m_Objects.end())
|
||||
|
||||
Reference in New Issue
Block a user