Commit d79745a7 authored by nadro's avatar nadro

- Minor improvements in D3D8/D3D9 blend operation mechanism.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4785 dfc29bdd-3216-0410-991c-e03cc46cb475
parent ad28d172
......@@ -1590,14 +1590,17 @@ void CD3D8Driver::setBasicRenderStates(const SMaterial& material, const SMateria
pID3DDevice->SetRenderState(D3DRS_COLORWRITEENABLE, flag);
}
if (queryFeature(EVDF_BLEND_OPERATIONS) &&
(resetAllRenderstates|| lastmaterial.BlendOperation != material.BlendOperation))
// Blend Operation
if (resetAllRenderstates || lastmaterial.BlendOperation != material.BlendOperation)
{
if (material.BlendOperation==EBO_NONE)
pID3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
else
{
pID3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
if (queryFeature(EVDF_BLEND_OPERATIONS))
{
switch (material.BlendOperation)
{
case EBO_MAX:
......@@ -1622,6 +1625,7 @@ void CD3D8Driver::setBasicRenderStates(const SMaterial& material, const SMateria
}
}
}
}
// Polygon offset
if (queryFeature(EVDF_POLYGON_OFFSET) && (resetAllRenderstates ||
......
......@@ -2301,14 +2301,17 @@ void CD3D9Driver::setBasicRenderStates(const SMaterial& material, const SMateria
pID3DDevice->SetRenderState(D3DRS_COLORWRITEENABLE, flag);
}
if (queryFeature(EVDF_BLEND_OPERATIONS) &&
(resetAllRenderstates|| lastmaterial.BlendOperation != material.BlendOperation))
// Blend Operation
if (resetAllRenderstates || lastmaterial.BlendOperation != material.BlendOperation)
{
if (material.BlendOperation==EBO_NONE)
pID3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
else
{
pID3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
if (queryFeature(EVDF_BLEND_OPERATIONS))
{
switch (material.BlendOperation)
{
case EBO_SUBTRACT:
......@@ -2333,6 +2336,7 @@ void CD3D9Driver::setBasicRenderStates(const SMaterial& material, const SMateria
}
}
}
}
// Polygon offset
if (queryFeature(EVDF_POLYGON_OFFSET) && (resetAllRenderstates ||
......
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