mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-25 01:52:31 +00:00
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:
@@ -51,7 +51,7 @@ CSkeletonAnimManager::~CSkeletonAnimManager()
|
||||
// doesn't refer to valid animation file
|
||||
CSkeletonAnimDef* CSkeletonAnimManager::GetAnimation(const VfsPath& pathname)
|
||||
{
|
||||
VfsPath name = Path::ChangeExtension(pathname, L"");
|
||||
VfsPath name = pathname.ChangeExtension(L"");
|
||||
|
||||
// Find if it's already been loaded
|
||||
boost::unordered_map<VfsPath, CSkeletonAnimDef*>::iterator iter = m_Animations.find(name);
|
||||
@@ -65,7 +65,7 @@ CSkeletonAnimDef* CSkeletonAnimManager::GetAnimation(const VfsPath& pathname)
|
||||
|
||||
if (psaFilename.empty())
|
||||
{
|
||||
LOGERROR(L"Could not load animation '%ls'", pathname.c_str());
|
||||
LOGERROR(L"Could not load animation '%ls'", pathname.string().c_str());
|
||||
def = NULL;
|
||||
}
|
||||
else
|
||||
@@ -81,9 +81,9 @@ CSkeletonAnimDef* CSkeletonAnimManager::GetAnimation(const VfsPath& pathname)
|
||||
}
|
||||
|
||||
if (def)
|
||||
LOGMESSAGE(L"CSkeletonAnimManager::GetAnimation(%ls): Loaded successfully", pathname.c_str());
|
||||
LOGMESSAGE(L"CSkeletonAnimManager::GetAnimation(%ls): Loaded successfully", pathname.string().c_str());
|
||||
else
|
||||
LOGERROR(L"CSkeletonAnimManager::GetAnimation(%ls): Failed loading, marked file as bad", pathname.c_str());
|
||||
LOGERROR(L"CSkeletonAnimManager::GetAnimation(%ls): Failed loading, marked file as bad", pathname.string().c_str());
|
||||
|
||||
// Add to map
|
||||
m_Animations[name] = def; // NULL if failed to load - we won't try loading it again
|
||||
|
||||
Reference in New Issue
Block a user