mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 13:15:32 +00:00
Terrain: destroy no longer used materials
This commit is contained in:
parent
97c3efb3ba
commit
6a002d19b3
2 changed files with 10 additions and 0 deletions
|
@ -3,6 +3,10 @@
|
|||
#include <OgreSceneNode.h>
|
||||
#include <OgreHardwareBufferManager.h>
|
||||
#include <OgreRenderQueue.h>
|
||||
#include <OgreMaterialManager.h>
|
||||
|
||||
#include <extern/shiny/Main/Factory.hpp>
|
||||
|
||||
|
||||
#include "world.hpp" // FIXME: for LoadResponseData, move to backgroundloader.hpp
|
||||
|
||||
|
@ -63,6 +67,11 @@ namespace Terrain
|
|||
|
||||
Chunk::~Chunk()
|
||||
{
|
||||
#if TERRAIN_USE_SHADER
|
||||
sh::Factory::getInstance().destroyMaterialInstance(mMaterial->getName());
|
||||
#endif
|
||||
Ogre::MaterialManager::getSingleton().remove(mMaterial->getName());
|
||||
|
||||
OGRE_DELETE mVertexData;
|
||||
OGRE_DELETE mIndexData;
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ namespace Terrain
|
|||
|
||||
virtual ~Chunk();
|
||||
|
||||
/// @note Takes ownership of \a material
|
||||
void setMaterial (const Ogre::MaterialPtr& material);
|
||||
|
||||
void setIndexBuffer(Ogre::HardwareIndexBufferSharedPtr buffer);
|
||||
|
|
Loading…
Reference in a new issue