Improved skin render when several players are selecting the same kart

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5553 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria
2010-06-24 18:40:44 +00:00
parent dcc4d54365
commit 48e1f98209

View File

@@ -825,7 +825,8 @@ void Skin::drawRibbonChild(const core::rect< s32 > &rect, Widget* widget, const
//parentRibbon->getSelectionIDString(1) << " vs " << widget->m_properties[PROP_ID].c_str() << std::endl;
//}
if (parentRibbon->isFocusedForPlayer(1) && parentRibbon->getSelectionIDString(1) == widget->m_properties[PROP_ID])
if (parentRibbon->isFocusedForPlayer(1) &&
parentRibbon->getSelectionIDString(1) == widget->m_properties[PROP_ID])
{
if (nPlayersOnThisItem > 0)
{
@@ -835,25 +836,60 @@ void Skin::drawRibbonChild(const core::rect< s32 > &rect, Widget* widget, const
rect2.UpperLeftCorner.Y -= enlarge;
rect2.LowerRightCorner.X += enlarge;
rect2.LowerRightCorner.Y += enlarge;
drawBoxFromStretchableTexture(parentRibbonWidget, rect2, SkinConfig::m_render_params["squareFocusHalo2::neutral"]);
drawBoxFromStretchableTexture(parentRibbonWidget, rect2,
SkinConfig::m_render_params["squareFocusHalo2::neutral"]);
}
else
{
drawBoxFromStretchableTexture(parentRibbonWidget, rect, SkinConfig::m_render_params["squareFocusHalo2::neutral"]);
drawBoxFromStretchableTexture(parentRibbonWidget, rect,
SkinConfig::m_render_params["squareFocusHalo2::neutral"]);
}
nPlayersOnThisItem++;
}
if (parentRibbon->isFocusedForPlayer(2) && parentRibbon->getSelectionIDString(2) == widget->m_properties[PROP_ID])
if (parentRibbon->isFocusedForPlayer(2) &&
parentRibbon->getSelectionIDString(2) == widget->m_properties[PROP_ID])
{
drawBoxFromStretchableTexture(parentRibbonWidget, rect, SkinConfig::m_render_params["squareFocusHalo3::neutral"]);
if (nPlayersOnThisItem > 0)
{
core::rect< s32 > rect2 = rect;
const int enlarge = nPlayersOnThisItem*6;
rect2.UpperLeftCorner.X -= enlarge;
rect2.UpperLeftCorner.Y -= enlarge;
rect2.LowerRightCorner.X += enlarge;
rect2.LowerRightCorner.Y += enlarge;
drawBoxFromStretchableTexture(parentRibbonWidget, rect2,
SkinConfig::m_render_params["squareFocusHalo3::neutral"]);
}
else
{
drawBoxFromStretchableTexture(parentRibbonWidget, rect,
SkinConfig::m_render_params["squareFocusHalo3::neutral"]);
}
nPlayersOnThisItem++;
}
if (parentRibbon->isFocusedForPlayer(3) && parentRibbon->getSelectionIDString(3) == widget->m_properties[PROP_ID])
if (parentRibbon->isFocusedForPlayer(3) &&
parentRibbon->getSelectionIDString(3) == widget->m_properties[PROP_ID])
{
drawBoxFromStretchableTexture(parentRibbonWidget, rect, SkinConfig::m_render_params["squareFocusHalo4::neutral"]);
if (nPlayersOnThisItem > 0)
{
core::rect< s32 > rect2 = rect;
const int enlarge = nPlayersOnThisItem*6;
rect2.UpperLeftCorner.X -= enlarge;
rect2.UpperLeftCorner.Y -= enlarge;
rect2.LowerRightCorner.X += enlarge;
rect2.LowerRightCorner.Y += enlarge;
drawBoxFromStretchableTexture(parentRibbonWidget, rect2,
SkinConfig::m_render_params["squareFocusHalo4::neutral"]);
}
else
{
drawBoxFromStretchableTexture(parentRibbonWidget, rect,
SkinConfig::m_render_params["squareFocusHalo4::neutral"]);
}
nPlayersOnThisItem++;
}
drawIconButton(rect, widget, pressed, focused);