1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-15 22:49:48 +00:00

Merge branch 'texturetype' into 'master'

In TextureType, use osg::Object's name field

See merge request OpenMW/openmw!4143
This commit is contained in:
psi29a 2024-06-01 15:31:27 +00:00
commit 615d503731
2 changed files with 2 additions and 15 deletions

View File

@ -145,9 +145,6 @@ namespace SceneUtil
: osgDB::ObjectWrapper(createInstanceFunc<SceneUtil::TextureType>, "SceneUtil::TextureType",
"osg::Object osg::StateAttribute SceneUtil::TextureType")
{
addSerializer(new osgDB::StringSerializer<SceneUtil::TextureType>(
"Name", {}, &SceneUtil::TextureType::getName, &SceneUtil::TextureType::setName),
osgDB::BaseSerializer::RW_STRING);
}
};

View File

@ -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