Commit 07de4257 authored by hybrid's avatar hybrid

Support relative filenames in serialization

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3709 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 649dfc93
...@@ -777,7 +777,15 @@ void CAnimatedMeshSceneNode::serializeAttributes(io::IAttributes* out, io::SAttr ...@@ -777,7 +777,15 @@ void CAnimatedMeshSceneNode::serializeAttributes(io::IAttributes* out, io::SAttr
{ {
IAnimatedMeshSceneNode::serializeAttributes(out, options); IAnimatedMeshSceneNode::serializeAttributes(out, options);
out->addString("Mesh", SceneManager->getMeshCache()->getMeshName(Mesh).getPath().c_str()); if (options && (options->Flags&io::EARWF_USE_RELATIVE_PATHS) && options->Filename)
{
const io::path path = SceneManager->getFileSystem()->getRelativeFilename(
SceneManager->getFileSystem()->getAbsolutePath(SceneManager->getMeshCache()->getMeshName(Mesh).getPath()),
options->Filename);
out->addString("Mesh", path.c_str());
}
else
out->addString("Mesh", SceneManager->getMeshCache()->getMeshName(Mesh).getPath().c_str());
out->addBool("Looping", Looping); out->addBool("Looping", Looping);
out->addBool("ReadOnlyMaterials", ReadOnlyMaterials); out->addBool("ReadOnlyMaterials", ReadOnlyMaterials);
out->addFloat("FramesPerSecond", FramesPerSecond); out->addFloat("FramesPerSecond", FramesPerSecond);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment