From cbe61e2c930e6e9aa0d3627399ab1383efa7ee82 Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Fri, 31 May 2024 14:22:41 +0300 Subject: [PATCH] In TextureType, use osg::Object's name field --- components/sceneutil/serialize.cpp | 3 --- components/sceneutil/texturetype.hpp | 14 ++------------ 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/components/sceneutil/serialize.cpp b/components/sceneutil/serialize.cpp index 90f0e7e7a6..93237dc02d 100644 --- a/components/sceneutil/serialize.cpp +++ b/components/sceneutil/serialize.cpp @@ -145,9 +145,6 @@ namespace SceneUtil : osgDB::ObjectWrapper(createInstanceFunc, "SceneUtil::TextureType", "osg::Object osg::StateAttribute SceneUtil::TextureType") { - addSerializer(new osgDB::StringSerializer( - "Name", {}, &SceneUtil::TextureType::getName, &SceneUtil::TextureType::setName), - osgDB::BaseSerializer::RW_STRING); } }; diff --git a/components/sceneutil/texturetype.hpp b/components/sceneutil/texturetype.hpp index 648fa6f80e..dbed8a0e74 100644 --- a/components/sceneutil/texturetype.hpp +++ b/components/sceneutil/texturetype.hpp @@ -11,14 +11,10 @@ namespace SceneUtil public: TextureType() = default; - TextureType(const std::string& name) - : mName(name) - { - } + TextureType(const std::string& name) { setName(name); } TextureType(const TextureType& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY) : StateAttribute(copy, copyop) - , mName(copy.mName) { } @@ -30,15 +26,9 @@ namespace SceneUtil int compare(const osg::StateAttribute& sa) const override { COMPARE_StateAttribute_Types(TextureType, sa); - COMPARE_StateAttribute_Parameter(mName); + COMPARE_StateAttribute_Parameter(_name); return 0; } - - void setName(const std::string& name) { mName = name; } - const std::string& getName() const { return mName; } - - private: - std::string mName; }; } #endif