- Collada Exporter id naming scheme once again revised to exclude any potential invalid chars

- Collada Exporter outputs proper URLs for texture file names now.
- Updated Collada Loader to understand and convert texture file name URLs

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1191 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
ulfjorensen
2012-03-08 16:08:46 +00:00
parent 3ed356d3c4
commit 6970307b4e
2 changed files with 32 additions and 8 deletions

View File

@@ -1398,6 +1398,24 @@ void ColladaLoader::ConvertPath (aiString& ss)
memmove(ss.data,ss.data+7,ss.length);
ss.data[ss.length] = '\0';
}
// find and convert all %xyz special chars
char* out = ss.data;
for( const char* it = ss.data; it != ss.data + ss.length; /**/ )
{
if( *it == '%' )
{
size_t nbr = strtoul16( ++it, &it);
*out++ = nbr;
} else
{
*out++ = *it++;
}
}
// adjust length and terminator of the shortened string
*out = 0;
ss.length = (ptrdiff_t) (out - ss.data);
}
// ------------------------------------------------------------------------------------------------