Exemple #1
0
void NzMaterial::Reset()
{
	NotifyDestroy();

	m_alphaMap.Reset();
	m_diffuseMap.Reset();
	m_emissiveMap.Reset();
	m_heightMap.Reset();
	m_normalMap.Reset();
	m_specularMap.Reset();
	m_uberShader.Reset();

	for (ShaderInstance& instance : m_shaders)
		instance.uberInstance = nullptr;

	m_alphaThreshold = 0.2f;
	m_alphaTestEnabled = false;
	m_ambientColor = NzColor(128, 128, 128);
	m_diffuseColor = NzColor::White;
	m_diffuseSampler = NzTextureSampler();
	m_lightingEnabled = true;
	m_shininess = 50.f;
	m_specularColor = NzColor::White;
	m_specularSampler = NzTextureSampler();
	m_states = NzRenderStates();
	m_states.parameters[nzRendererParameter_DepthBuffer] = true;
	m_states.parameters[nzRendererParameter_FaceCulling] = true;
	m_transformEnabled = true;

	SetShader("Basic");
}
Exemple #2
0
void NzStaticMesh::Destroy()
{
	if (m_vertexBuffer)
	{
		NotifyDestroy();

		m_indexBuffer.Reset();
		m_vertexBuffer.Reset();
	}
}
void NzAnimation::Destroy()
{
	if (m_impl)
	{
		NotifyDestroy();

		delete m_impl;
		m_impl = nullptr;
	}
}
Exemple #4
0
void NzStaticMesh::Destroy()
{
	if (m_vertexBuffer)
	{
		NotifyDestroy();

		if (m_indexBuffer)
		{
			m_indexBuffer->RemoveResourceListener(this);
			m_indexBuffer = nullptr;
		}

		m_vertexBuffer->RemoveResourceListener(this);
		m_vertexBuffer = nullptr;
	}
}
Exemple #5
0
void NzMesh::Destroy()
{
	if (m_impl)
	{
		NotifyDestroy();

		for (NzSubMesh* subMesh : m_impl->subMeshes)
		{
			subMesh->RemoveResourceListener(this);
			subMesh->RemoveResourceReference();
		}

		delete m_impl;
		m_impl = nullptr;
	}
}
void CClientObject::Destroy ( void )
{
    // If the object exists
    if ( m_pObject )
    {
        // Invalidate
        m_pManager->InvalidateEntity ( this );

        // Remove XRef
        g_pClientGame->GetGameEntityXRefManager ()->RemoveEntityXRef ( this, m_pObject );

        // Destroy the object
        g_pGame->GetPools ()->RemoveObject ( m_pObject );
        m_pObject = NULL;

        // Remove our reference to its model
        m_pModelInfo->RemoveRef ();

        NotifyDestroy ();
    }
}
Exemple #7
0
NzMaterial::~NzMaterial()
{
	NotifyDestroy();
}