Commit fb196550 authored by hybrid's avatar hybrid

Workaround avoiding wrong renderstate with culling modes.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1669 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 8b8efafc
......@@ -29,37 +29,40 @@ namespace video
EMF_ZBUFFER,
//! May be written to the zbuffer or is it readonly. Default: true
//! This flag is ignored, if the material type is a transparent type.
/** This flag is ignored, if the material type is a transparent type. */
EMF_ZWRITE_ENABLE,
//! Is backface culling enabled? Default: true
EMF_BACK_FACE_CULLING,
//! Is frontface culling enabled? Default: false
/** Overrides EMF_BACK_FACE_CULLING if both are enabled. */
EMF_FRONT_FACE_CULLING,
//! Is bilinear filtering enabled? Default: true
EMF_BILINEAR_FILTER,
//! Is trilinear filtering enabled? Default: false
//! If the trilinear filter flag is enabled,
//! the bilinear filtering flag is ignored.
/** If the trilinear filter flag is enabled,
the bilinear filtering flag is ignored. */
EMF_TRILINEAR_FILTER,
//! Is anisotropic filtering? Default: false
//! In Irrlicht you can use anisotropic texture filtering in
//! conjunction with bilinear or trilinear texture filtering
//! to improve rendering results. Primitives will look less
//! blurry with this flag switched on.
/** In Irrlicht you can use anisotropic texture filtering in
conjunction with bilinear or trilinear texture filtering
to improve rendering results. Primitives will look less
blurry with this flag switched on. */
EMF_ANISOTROPIC_FILTER,
//! Is fog enabled? Default: false
EMF_FOG_ENABLE,
//! Normalizes normals.You can enable this if you need
//! to scale a dynamic lighted model. Usually, its normals will get scaled
//! too then and it will get darker. If you enable the EMF_NORMALIZE_NORMALS flag,
//! the normals will be normalized again, and the model will look as bright as it should.
//! Normalizes normals. Default: false
/** You can enable this if you need to scale a dynamic lighted
model. Usually, its normals will get scaled too then and it
will get darker. If you enable the EMF_NORMALIZE_NORMALS flag,
the normals will be normalized again, and the model will look
as bright as it should. */
EMF_NORMALIZE_NORMALS,
//! Access to all layers texture wrap settings. Overwrites separate layer settings.
......
......@@ -1409,9 +1409,9 @@ void CD3D8Driver::setBasicRenderStates(const SMaterial& material, const SMateria
if (resetAllRenderstates || (lastmaterial.FrontfaceCulling != material.FrontfaceCulling) || (lastmaterial.BackfaceCulling != material.BackfaceCulling))
{
if (material.FrontfaceCulling && material.BackfaceCulling)
pID3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW|D3DCULL_CCW);
else
// if (material.FrontfaceCulling && material.BackfaceCulling)
// pID3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW|D3DCULL_CCW);
// else
if (material.FrontfaceCulling)
pID3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW);
else
......
......@@ -716,14 +716,14 @@ bool CD3D9Driver::setRenderTarget(video::ITexture* texture,
// check for valid render target
CD3D9Texture* tex = (CD3D9Texture*)texture;
if (texture && !tex->isRenderTarget())
if (texture && !texture->isRenderTarget())
{
os::Printer::log("Fatal Error: Tried to set a non render target texture as render target.", ELL_ERROR);
return false;
}
CD3D9Texture* tex = static_cast<CD3D9Texture*>(texture);
if (texture && (tex->getSize().Width > CurrentDepthBufferSize.Width ||
tex->getSize().Height > CurrentDepthBufferSize.Height))
{
......@@ -1707,9 +1707,9 @@ void CD3D9Driver::setBasicRenderStates(const SMaterial& material, const SMateria
if (resetAllRenderstates || (lastmaterial.FrontfaceCulling != material.FrontfaceCulling) || (lastmaterial.BackfaceCulling != material.BackfaceCulling))
{
if (material.FrontfaceCulling && material.BackfaceCulling)
pID3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW|D3DCULL_CCW);
else
// if (material.FrontfaceCulling && material.BackfaceCulling)
// pID3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW|D3DCULL_CCW);
// else
if (material.FrontfaceCulling)
pID3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW);
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment