IColladaMeshWriter::writeScene got an additional flag to decide if root should be written.

Default stays as it was - a roots is written when it's not the SceneManager root.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5691 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2019-01-24 15:39:45 +00:00
parent eb14f13b53
commit f6da59daf3
4 changed files with 6 additions and 4 deletions

View File

@ -1,5 +1,6 @@
--------------------------
Changes in 1.9 (not yet released)
- IColladaMeshWriter::writeScene got an additional flag to decide if root should be written.
- _IRR_MATERIAL_MAX_TEXTURES_ now set to 8 by default. So we can use now 8 textures per material without recompiling the engine.
Additionally there's a new global variable irr::video::MATERIAL_MAX_TEXTURES_USED which can be set to lower numbers to avoid most of the costs coming with this for people not needing more textures.
But using more textures via _IRR_MATERIAL_MAX_TEXTURES_ also has become less calculation intensive than it was in the past, so in release builds the difference is hardly noticeable.

View File

@ -224,7 +224,8 @@ namespace scene
}
//! writes a scene starting with the given node
virtual bool writeScene(io::IWriteFile* file, scene::ISceneNode* root) = 0;
//\param writeRoot: 0 = no, 1=yes unless root is scenemanager, 2=yes
virtual bool writeScene(io::IWriteFile* file, scene::ISceneNode* root, int writeRoot=1) = 0;
//! Set if texture information should be written

View File

@ -275,7 +275,7 @@ EMESH_WRITER_TYPE CColladaMeshWriter::getType() const
}
//! writes a scene starting with the given node
bool CColladaMeshWriter::writeScene(io::IWriteFile* file, scene::ISceneNode* root)
bool CColladaMeshWriter::writeScene(io::IWriteFile* file, scene::ISceneNode* root, int writeRoot)
{
if (!file || !root)
return false;
@ -365,7 +365,7 @@ bool CColladaMeshWriter::writeScene(io::IWriteFile* file, scene::ISceneNode* roo
Writer->writeLineBreak();
// Write the scenegraph.
if ( root->getType() != ESNT_SCENE_MANAGER )
if ( writeRoot == 2 || (writeRoot == 1 && root->getType() != ESNT_SCENE_MANAGER) )
{
// TODO: Not certain if we should really write the root or if we should just always only write the children.
// For now writing root to keep backward compatibility for this case, but if anyone needs to _not_ write

View File

@ -88,7 +88,7 @@ public:
virtual EMESH_WRITER_TYPE getType() const _IRR_OVERRIDE_;
//! writes a scene starting with the given node
virtual bool writeScene(io::IWriteFile* file, scene::ISceneNode* root) _IRR_OVERRIDE_;
virtual bool writeScene(io::IWriteFile* file, scene::ISceneNode* root, int writeRoot) _IRR_OVERRIDE_;
//! writes a mesh
virtual bool writeMesh(io::IWriteFile* file, scene::IMesh* mesh, s32 flags=EMWF_NONE) _IRR_OVERRIDE_;