If dynamic material already exists, simply just reinitialize it.

--HG--
branch : gsoc2013-dfighter
hg/feature/gsoc2013-dfighter
dfighter1985 12 years ago
parent e99c1e2785
commit 80bcf2026a

@ -81,6 +81,7 @@ namespace NL3D
public:
CDynMaterial();
~CDynMaterial();
void reconstruct();
void clear();
void serial( NLMISC::IStream &f );
std::string getClassName(){ return "CDynMaterial"; }

@ -150,9 +150,7 @@ namespace NL3D
CDynMaterial::CDynMaterial()
{
SRenderPass *p = new SRenderPass();
p->setName( "pass1" );
passes.push_back( p );
reconstruct();
}
CDynMaterial::~CDynMaterial()
@ -160,6 +158,14 @@ namespace NL3D
clear();
}
void CDynMaterial::reconstruct()
{
clear();
SRenderPass *p = new SRenderPass();
p->setName( "pass1" );
passes.push_back( p );
}
void CDynMaterial::clear()
{
std::vector< SRenderPass* >::iterator itr = passes.begin();

@ -641,6 +641,8 @@ void CMaterial::createDynMat()
{
if( dynMat == NULL )
dynMat = new CDynMaterial();
else
dynMat->reconstruct();
SRenderPass *p = dynMat->getPass( 0 );

Loading…
Cancel
Save