forked from mirror/openmw-tes3mp
Fix errors due to BaseWhite material being removed
This commit is contained in:
parent
0f1b39bca4
commit
7c9c0830a9
1 changed files with 6 additions and 1 deletions
|
@ -4,6 +4,7 @@
|
||||||
#include <OgreHardwareBufferManager.h>
|
#include <OgreHardwareBufferManager.h>
|
||||||
#include <OgreRenderQueue.h>
|
#include <OgreRenderQueue.h>
|
||||||
#include <OgreMaterialManager.h>
|
#include <OgreMaterialManager.h>
|
||||||
|
#include <OgreStringConverter.h>
|
||||||
|
|
||||||
#include <extern/shiny/Main/Factory.hpp>
|
#include <extern/shiny/Main/Factory.hpp>
|
||||||
|
|
||||||
|
@ -56,7 +57,11 @@ namespace Terrain
|
||||||
mVertexData->vertexBufferBinding->setBinding(3, colourBuffer);
|
mVertexData->vertexBufferBinding->setBinding(3, colourBuffer);
|
||||||
|
|
||||||
// Assign a default material in case terrain material fails to be created
|
// Assign a default material in case terrain material fails to be created
|
||||||
mMaterial = Ogre::MaterialManager::getSingleton().getByName("BaseWhite");
|
// Since we are removing this material in the destructor, it must be cloned from BaseWhite
|
||||||
|
// so the original always stays available.
|
||||||
|
static int materialCount=0;
|
||||||
|
mMaterial = Ogre::MaterialManager::getSingleton().getByName("BaseWhite")
|
||||||
|
->clone("BaseWhite"+Ogre::StringConverter::toString(++materialCount));
|
||||||
|
|
||||||
mIndexData = OGRE_NEW Ogre::IndexData();
|
mIndexData = OGRE_NEW Ogre::IndexData();
|
||||||
mIndexData->indexStart = 0;
|
mIndexData->indexStart = 0;
|
||||||
|
|
Loading…
Reference in a new issue