aboutsummaryrefslogtreecommitdiff
path: root/source/Irrlicht/CMeshSceneNode.cpp
diff options
context:
space:
mode:
authorROllerozxa <temporaryemail4meh+github@gmail.com>2021-12-29 23:00:56 +0100
committerGitHub <noreply@github.com>2021-12-29 23:00:56 +0100
commit52e03a8485d3f2ad9c2aa14341a2ad5aca74ee9d (patch)
tree79c04b2041d72c7306e325e9879ce6a07bcd71b8 /source/Irrlicht/CMeshSceneNode.cpp
parentdd09fdcb4e56fc6185ed25d39ab68fad88f31e3b (diff)
downloadirrlicht-52e03a8485d3f2ad9c2aa14341a2ad5aca74ee9d.tar.xz
Remove unused attribute saving and loading (#86)
Diffstat (limited to 'source/Irrlicht/CMeshSceneNode.cpp')
-rw-r--r--source/Irrlicht/CMeshSceneNode.cpp73
1 files changed, 2 insertions, 71 deletions
diff --git a/source/Irrlicht/CMeshSceneNode.cpp b/source/Irrlicht/CMeshSceneNode.cpp
index 0f5abd6..1331dda 100644
--- a/source/Irrlicht/CMeshSceneNode.cpp
+++ b/source/Irrlicht/CMeshSceneNode.cpp
@@ -170,8 +170,8 @@ void CMeshSceneNode::render()
if (DebugDataVisible & scene::EDS_NORMALS)
{
// draw normals
- const f32 debugNormalLength = SceneManager->getParameters()->getAttributeAsFloat(DEBUG_NORMAL_LENGTH);
- const video::SColor debugNormalColor = SceneManager->getParameters()->getAttributeAsColor(DEBUG_NORMAL_COLOR);
+ const f32 debugNormalLength = 1.f;
+ const video::SColor debugNormalColor = video::SColor(255, 34, 221, 221);
const u32 count = Mesh->getMeshBufferCount();
for (u32 i=0; i != count; ++i)
@@ -276,75 +276,6 @@ void CMeshSceneNode::copyMaterials()
}
-//! Writes attributes of the scene node.
-void CMeshSceneNode::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const
-{
- IMeshSceneNode::serializeAttributes(out, options);
-
- 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("ReadOnlyMaterials", ReadOnlyMaterials);
-}
-
-
-//! Reads attributes of the scene node.
-void CMeshSceneNode::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options)
-{
- io::path oldMeshStr = SceneManager->getMeshCache()->getMeshName(Mesh);
- io::path newMeshStr = in->getAttributeAsString("Mesh");
- ReadOnlyMaterials = in->getAttributeAsBool("ReadOnlyMaterials");
-
- if (newMeshStr != "" && oldMeshStr != newMeshStr)
- {
- IMesh* newMesh = 0;
- IAnimatedMesh* newAnimatedMesh = SceneManager->getMesh(newMeshStr.c_str());
-
- if (newAnimatedMesh)
- newMesh = newAnimatedMesh->getMesh(0);
-
- if (newMesh)
- setMesh(newMesh);
- }
-
- // optional attribute to assign the hint to the whole mesh
- if (in->existsAttribute("HardwareMappingHint") &&
- in->existsAttribute("HardwareMappingBufferType"))
- {
- scene::E_HARDWARE_MAPPING mapping = scene::EHM_NEVER;
- scene::E_BUFFER_TYPE bufferType = scene::EBT_NONE;
-
- core::stringc smapping = in->getAttributeAsString("HardwareMappingHint");
- if (smapping.equals_ignore_case("static"))
- mapping = scene::EHM_STATIC;
- else if (smapping.equals_ignore_case("dynamic"))
- mapping = scene::EHM_DYNAMIC;
- else if (smapping.equals_ignore_case("stream"))
- mapping = scene::EHM_STREAM;
-
- core::stringc sbufferType = in->getAttributeAsString("HardwareMappingBufferType");
- if (sbufferType.equals_ignore_case("vertex"))
- bufferType = scene::EBT_VERTEX;
- else if (sbufferType.equals_ignore_case("index"))
- bufferType = scene::EBT_INDEX;
- else if (sbufferType.equals_ignore_case("vertexindex"))
- bufferType = scene::EBT_VERTEX_AND_INDEX;
-
- IMesh* mesh = getMesh();
- if (mesh)
- mesh->setHardwareMappingHint(mapping, bufferType);
- }
-
- IMeshSceneNode::deserializeAttributes(in, options);
-}
-
-
//! Sets if the scene node should not copy the materials of the mesh but use them in a read only style.
/* In this way it is possible to change the materials a mesh causing all mesh scene nodes
referencing this mesh to change too. */