CGUISkin::draw3DSunkenPane no longer ignores fillBackGround in non-flat mode. Also borderlines are no longer drawn overlapping to avoid ugly corners.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3856 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2011-06-19 22:52:18 +00:00
parent 3d930cba96
commit dd3ef0fdd7
2 changed files with 50 additions and 23 deletions

View File

@ -1,5 +1,7 @@
Changes in 1.8 (??.??.2011)
- CGUISkin::draw3DSunkenPane no longer ignores fillBackGround in non-flat mode. Also borderlines are no longer drawn overlapping to avoid ugly corners.
- CDummyTransformationSceneNode::clone() added.
- IParticleSystemSceneNode::doParticleSystem now public to allow rendering outside scenegraph.

View File

@ -414,49 +414,74 @@ void CGUISkin::draw3DSunkenPane(IGUIElement* element, video::SColor bgcolor,
core::rect<s32> rect = r;
if (flat)
{
// draw flat sunken pane
if (fillBackGround)
Driver->draw2DRectangle(bgcolor, rect, clip);
rect.LowerRightCorner.Y = rect.UpperLeftCorner.Y + 1;
Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip);
if (flat)
{
// draw flat sunken pane
rect.LowerRightCorner.Y = rect.UpperLeftCorner.Y + 1;
Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip); // top
++rect.UpperLeftCorner.Y;
rect.LowerRightCorner.Y = r.LowerRightCorner.Y;
rect.LowerRightCorner.X = rect.UpperLeftCorner.X + 1;
Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip);
Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip); // left
rect = r;
++rect.UpperLeftCorner.Y;
rect.UpperLeftCorner.X = rect.LowerRightCorner.X - 1;
Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip);
Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip); // right
rect = r;
++rect.UpperLeftCorner.X;
rect.UpperLeftCorner.Y = r.LowerRightCorner.Y - 1;
rect.LowerRightCorner.Y = r.LowerRightCorner.Y;
Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip);
--rect.LowerRightCorner.X;
Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip); // bottom
}
else
{
// draw deep sunken pane
if (fillBackGround)
Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip);
rect.LowerRightCorner.X -= 1;
rect.LowerRightCorner.Y -= 1;
Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip);
rect.UpperLeftCorner.X += 1;
rect.UpperLeftCorner.Y += 1;
Driver->draw2DRectangle(getColor(EGDC_3D_LIGHT), rect, clip);
rect.LowerRightCorner.X -= 1;
rect.LowerRightCorner.Y -= 1;
rect.LowerRightCorner.Y = rect.UpperLeftCorner.Y + 1;
Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip); // top
++rect.UpperLeftCorner.X;
++rect.UpperLeftCorner.Y;
--rect.LowerRightCorner.X;
++rect.LowerRightCorner.Y;
Driver->draw2DRectangle(getColor(EGDC_3D_DARK_SHADOW), rect, clip);
rect.UpperLeftCorner.X += 1;
rect.UpperLeftCorner.Y += 1;
Driver->draw2DRectangle(bgcolor, rect, clip);
rect.UpperLeftCorner.X = r.UpperLeftCorner.X;
rect.UpperLeftCorner.Y = r.UpperLeftCorner.Y+1;
rect.LowerRightCorner.X = rect.UpperLeftCorner.X + 1;
rect.LowerRightCorner.Y = r.LowerRightCorner.Y;
Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip); // left
++rect.UpperLeftCorner.X;
++rect.UpperLeftCorner.Y;
++rect.LowerRightCorner.X;
--rect.LowerRightCorner.Y;
Driver->draw2DRectangle(getColor(EGDC_3D_DARK_SHADOW), rect, clip);
rect = r;
rect.UpperLeftCorner.X = rect.LowerRightCorner.X - 1;
++rect.UpperLeftCorner.Y;
Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip); // right
--rect.UpperLeftCorner.X;
++rect.UpperLeftCorner.Y;
--rect.LowerRightCorner.X;
--rect.LowerRightCorner.Y;
Driver->draw2DRectangle(getColor(EGDC_3D_LIGHT), rect, clip);
rect = r;
++rect.UpperLeftCorner.X;
rect.UpperLeftCorner.Y = r.LowerRightCorner.Y - 1;
--rect.LowerRightCorner.X;
Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip); // bottom
++rect.UpperLeftCorner.X;
--rect.UpperLeftCorner.Y;
--rect.LowerRightCorner.X;
--rect.LowerRightCorner.Y;
Driver->draw2DRectangle(getColor(EGDC_3D_LIGHT), rect, clip);
}
}