Commit 597d889 1 parent a48f757 commit 597d889 Copy full SHA for 597d889
File tree 4 files changed +4
-21
lines changed
include/gz/rendering/ogre2
4 files changed +4
-21
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ namespace gz
95
95
protected: Ogre2ScenePtr scene;
96
96
97
97
// / \brief Remove internal material cache for a specific material
98
+ // / \todo(iche033) Deprecate this function in gz-rendering10
98
99
public: void ClearMaterialsCache (const std::string &_name);
99
100
100
101
// / \brief Pointer to private data class
Original file line number Diff line number Diff line change @@ -457,6 +457,7 @@ namespace gz
457
457
458
458
// / \brief Remove internal material cache for a specific material
459
459
// / \param[in] _name Name of the template material to remove.
460
+ // / \todo(iche033) Deprecate this function in gz-rendering10
460
461
public: void ClearMaterialsCache (const std::string &_name);
461
462
462
463
// / \brief Create a shared pointer to self
Original file line number Diff line number Diff line change @@ -277,8 +277,6 @@ void Ogre2Material::Destroy()
277
277
278
278
if (textureToRemove && !textureIsUse)
279
279
{
280
- Ogre2ScenePtr s = std::dynamic_pointer_cast<Ogre2Scene>(this ->Scene ());
281
- s->ClearMaterialsCache (this ->textureName );
282
280
this ->Scene ()->UnregisterMaterial (this ->name );
283
281
textureManager->destroyTexture (textureToRemove);
284
282
}
Original file line number Diff line number Diff line change 57
57
// / \brief Private data for the Ogre2MeshFactory class
58
58
class gz ::rendering::Ogre2MeshFactoryPrivate
59
59
{
60
- // / \brief Vector with the template materials, we keep the pointer to be
61
- // / able to remove it when nobody is using it.
62
- public: std::vector<MaterialPtr> materialCache;
63
60
};
64
61
65
62
// / \brief Private data for the Ogre2SubMeshStoreFactory class
@@ -91,22 +88,9 @@ void Ogre2MeshFactory::Clear()
91
88
}
92
89
93
90
// ////////////////////////////////////////////////
94
- void Ogre2MeshFactory::ClearMaterialsCache (const std::string &_name )
91
+ void Ogre2MeshFactory::ClearMaterialsCache (const std::string &)
95
92
{
96
- auto it = this ->dataPtr ->materialCache .begin ();
97
- for (auto &mat : this ->dataPtr ->materialCache )
98
- {
99
- std::string matName = mat->Name ();
100
- std::string textureName = mat->Texture ();
101
- if (textureName == _name)
102
- {
103
- this ->scene ->UnregisterMaterial (matName);
104
- break ;
105
- }
106
- ++it;
107
- }
108
- if (it != this ->dataPtr ->materialCache .end ())
109
- this ->dataPtr ->materialCache .erase (it);
93
+ // no-op
110
94
}
111
95
112
96
// ////////////////////////////////////////////////
@@ -501,7 +485,6 @@ bool Ogre2MeshFactory::LoadImpl(const MeshDescriptor &_desc)
501
485
if (material)
502
486
{
503
487
mat->CopyFrom (*material);
504
- this ->dataPtr ->materialCache .push_back (mat);
505
488
}
506
489
else
507
490
{
You can’t perform that action at this time.
0 commit comments