added above team leader's head a red/blue ball to indicate team.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/soccer@13418 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
yasin-ghannam 2013-08-06 03:30:42 +00:00
parent a908f4d3f9
commit a3be77aa30

View File

@ -224,6 +224,20 @@ void RaceGUI::drawScores()
static video::SColor color = video::SColor(255,255,255,255);
//Draw kart icons above score(denoting teams)
irr::video::ITexture *red_team = irr_driver->getTexture(
file_manager->getTextureFile("soccer_ball_red.png"));
irr::video::ITexture *blue_team = irr_driver->getTexture(
file_manager->getTextureFile("soccer_ball_blue.png"));
core::rect<s32> indicatorPos(offsetX-6, offsetY,
offsetX -6 + red_team->getSize().Width/8,
offsetY + red_team->getSize().Height/8);
core::rect<s32> sourceRect(core::position2d<s32>(0,0),
red_team->getOriginalSize());
irr_driver->getVideoDriver()->draw2DImage(red_team,indicatorPos,sourceRect,
NULL,NULL,true);
for(unsigned int i=0; i<soccerWorld->getNumKarts(); i++){
int j = soccerWorld->getTeamLeader(i);
if(j < 0) break;
@ -247,6 +261,15 @@ void RaceGUI::drawScores()
font->draw(score.c_str(),pos,color);
offsetX += position.LowerRightCorner.X;
}
offsetX = 80;
offsetY = 5;
indicatorPos = core::rect<s32>(offsetX, offsetY,
offsetX + blue_team->getSize().Width/8,
offsetY + blue_team->getSize().Height/8);
sourceRect = core::rect<s32> (core::position2d<s32>(0,0),
blue_team->getOriginalSize());
irr_driver->getVideoDriver()->draw2DImage(blue_team,indicatorPos,sourceRect,
NULL,NULL,true);
}
//-----------------------------------------------------------------------------
/** Displays the racing time on the screen.s