File tree Expand file tree Collapse file tree 4 files changed +4
-21
lines changed
include/gz/rendering/ogre2 Expand file tree Collapse file tree 4 files changed +4
-21
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ namespace gz
9595 protected: Ogre2ScenePtr scene;
9696
9797 // / \brief Remove internal material cache for a specific material
98+ // / \todo(iche033) Deprecate this function in gz-rendering10
9899 public: void ClearMaterialsCache (const std::string &_name);
99100
100101 // / \brief Pointer to private data class
Original file line number Diff line number Diff line change @@ -444,6 +444,7 @@ namespace gz
444444
445445 // / \brief Remove internal material cache for a specific material
446446 // / \param[in] _name Name of the template material to remove.
447+ // / \todo(iche033) Deprecate this function in gz-rendering10
447448 public: void ClearMaterialsCache (const std::string &_name);
448449
449450 // / \brief Create a shared pointer to self
Original file line number Diff line number Diff line change @@ -277,8 +277,6 @@ void Ogre2Material::Destroy()
277277
278278 if (textureToRemove && !textureIsUse)
279279 {
280- Ogre2ScenePtr s = std::dynamic_pointer_cast<Ogre2Scene>(this ->Scene ());
281- s->ClearMaterialsCache (this ->textureName );
282280 this ->Scene ()->UnregisterMaterial (this ->name );
283281 textureManager->destroyTexture (textureToRemove);
284282 }
Original file line number Diff line number Diff line change 5757// / \brief Private data for the Ogre2MeshFactory class
5858class gz ::rendering::Ogre2MeshFactoryPrivate
5959{
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;
6360};
6461
6562// / \brief Private data for the Ogre2SubMeshStoreFactory class
@@ -91,22 +88,9 @@ void Ogre2MeshFactory::Clear()
9188}
9289
9390// ////////////////////////////////////////////////
94- void Ogre2MeshFactory::ClearMaterialsCache (const std::string &_name )
91+ void Ogre2MeshFactory::ClearMaterialsCache (const std::string &)
9592{
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
11094}
11195
11296// ////////////////////////////////////////////////
@@ -501,7 +485,6 @@ bool Ogre2MeshFactory::LoadImpl(const MeshDescriptor &_desc)
501485 if (material)
502486 {
503487 mat->CopyFrom (*material);
504- this ->dataPtr ->materialCache .push_back (mat);
505488 }
506489 else
507490 {
You can’t perform that action at this time.
0 commit comments