1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-01 03:21:41 +00:00

Make OSGTexture final

To show that there are no more inheritance levels and also help compiler to
better optimize virtual function calls. There is no need to access virtual table
when compiler calls a virtual function of a final type.
This commit is contained in:
elsid 2022-07-20 21:53:21 +02:00
parent 5f800279ac
commit d165966bea
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

View File

@ -20,7 +20,8 @@ namespace Resource
namespace osgMyGUI
{
class OSGTexture : public MyGUI::ITexture {
class OSGTexture final : public MyGUI::ITexture
{
std::string mName;
Resource::ImageManager* mImageManager;
@ -37,7 +38,7 @@ namespace osgMyGUI
public:
OSGTexture(const std::string &name, Resource::ImageManager* imageManager);
OSGTexture(osg::Texture2D* texture, osg::StateSet* injectState = nullptr);
virtual ~OSGTexture();
~OSGTexture() override;
osg::StateSet* getInjectState() { return mInjectState; }