1
0
Fork 1
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:
scrawl 2014-02-28 03:15:04 +01:00
parent 97c3efb3ba
commit 6a002d19b3
2 changed files with 10 additions and 0 deletions

View file

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

View file

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