Commit f09f35e0 authored by cutealien's avatar cutealien

Make nameFor functions in IColladaMeshWriterNames non-const as it's not...

Make nameFor functions in IColladaMeshWriterNames non-const as it's not necessary in the writer and we don't know what people will do with it (and because I already needed it non-const to avoid ugly mutable variables in writing the example).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4269 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 8fbc2fb8
......@@ -147,13 +147,13 @@ namespace scene
/** Note that names really must be unique here per mesh-pointer, so mostly it's a good idea to return
the nameForMesh from IColladaMeshWriter::getDefaultNameGenerator().
*/
virtual irr::core::stringw nameForMesh(const scene::IMesh* mesh) const = 0;
virtual irr::core::stringw nameForMesh(const scene::IMesh* mesh) = 0;
//! Return a unique name for the given node
/** Note that names really must be unique here per node-pointer, so mostly it's a good idea to return
the nameForNode from IColladaMeshWriter::getDefaultNameGenerator().
*/
virtual irr::core::stringw nameForNode(const scene::ISceneNode* node) const = 0;
virtual irr::core::stringw nameForNode(const scene::ISceneNode* node) = 0;
//! Return a name for the material
/** There is one material created in the writer for each unique name. So you can use this to control
......@@ -161,7 +161,7 @@ namespace scene
material instanced by a node. So if you know that in your application material instances per node are identical
between different nodes you can reduce the number of exported materials using that knowledge by using identical
names for such shared materials. */
virtual irr::core::stringw nameForMaterial(const video::SMaterial & material, int materialId, const scene::IMesh* mesh, const scene::ISceneNode* node) const = 0;
virtual irr::core::stringw nameForMaterial(const video::SMaterial & material, int materialId, const scene::IMesh* mesh, const scene::ISceneNode* node) = 0;
//! Ensure meshnames follow the xs::NCName format (so this will change names!)
/** Names need to have a certain format in collada, like not starting with numbers,
......
......@@ -142,14 +142,14 @@ CColladaMeshWriterNames::CColladaMeshWriterNames()
SetConvertMaterialNameToNC(true);
}
irr::core::stringw CColladaMeshWriterNames::nameForMesh(const scene::IMesh* mesh) const
irr::core::stringw CColladaMeshWriterNames::nameForMesh(const scene::IMesh* mesh)
{
irr::core::stringw name(L"mesh");
name += nameForPtr(mesh);
return name;
}
irr::core::stringw CColladaMeshWriterNames::nameForNode(const scene::ISceneNode* node) const
irr::core::stringw CColladaMeshWriterNames::nameForNode(const scene::ISceneNode* node)
{
irr::core::stringw name;
// Prefix, because xs::ID can't start with a number, also nicer name
......@@ -165,7 +165,7 @@ irr::core::stringw CColladaMeshWriterNames::nameForNode(const scene::ISceneNode*
return name;
}
irr::core::stringw CColladaMeshWriterNames::nameForMaterial(const video::SMaterial & material, int materialId, const scene::IMesh* mesh, const scene::ISceneNode* node) const
irr::core::stringw CColladaMeshWriterNames::nameForMaterial(const video::SMaterial & material, int materialId, const scene::IMesh* mesh, const scene::ISceneNode* node)
{
core::stringw strMat(L"mat");
......
......@@ -60,9 +60,9 @@ namespace scene
{
public:
CColladaMeshWriterNames();
virtual irr::core::stringw nameForMesh(const scene::IMesh* mesh) const;
virtual irr::core::stringw nameForNode(const scene::ISceneNode* node) const;
virtual irr::core::stringw nameForMaterial(const video::SMaterial & material, int materialId, const scene::IMesh* mesh, const scene::ISceneNode* node) const;
virtual irr::core::stringw nameForMesh(const scene::IMesh* mesh);
virtual irr::core::stringw nameForNode(const scene::ISceneNode* node);
virtual irr::core::stringw nameForMaterial(const video::SMaterial & material, int materialId, const scene::IMesh* mesh, const scene::ISceneNode* node);
protected:
irr::core::stringw nameForPtr(const void* ptr) const;
};
......
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