fixed a FIXME (minor change)

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5107 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2010-03-31 23:49:42 +00:00
parent 2a06f7b2c0
commit 1be79f8a72
4 changed files with 16 additions and 11 deletions

@ -415,11 +415,11 @@ RaceGUI::KartIconDisplayInfo* LinearWorld::getKartsDisplayInfo()
- time_of_leader; - time_of_leader;
str = "+" + StringUtils::timeToString(timeBehind); str = "+" + StringUtils::timeToString(timeBehind);
} }
rank_info.time = irr::core::stringw(str.c_str()); rank_info.m_text = irr::core::stringw(str.c_str());
} }
else else
{ {
rank_info.time = ""; rank_info.m_text = "";
} }
int numLaps = race_manager->getNumLaps(); int numLaps = race_manager->getNumLaps();

@ -238,7 +238,7 @@ RaceGUI::KartIconDisplayInfo* ThreeStrikesBattle::getKartsDisplayInfo()
char lives[4]; char lives[4];
sprintf(lives, "%i", m_kart_info[i].m_lives); sprintf(lives, "%i", m_kart_info[i].m_lives);
rank_info.time = lives; // FIXME - rename 'time' to something more generic rank_info.m_text = lives;
} }
return m_kart_display_info; return m_kart_display_info;

@ -363,13 +363,13 @@ void RaceGUI::drawGlobalPlayerIcons(const KartIconDisplayInfo* info)
y = y_base + ( (position == -1 ? i : position-1)*(ICON_PLAYER_WIDTH+2)); y = y_base + ( (position == -1 ? i : position-1)*(ICON_PLAYER_WIDTH+2));
if (info[i].time.size() > 0) if (info[i].m_text.size() > 0)
{ {
video::SColor color = video::SColor(255, (int)(255*info[i].r), video::SColor color = video::SColor(255, (int)(255*info[i].r),
(int)(255*info[i].g), (int)(255*info[i].g),
(int)(255*info[i].b) ); (int)(255*info[i].b) );
core::rect<s32> pos(x+ICON_PLAYER_WIDTH, y+5, x+ICON_PLAYER_WIDTH, y+5); core::rect<s32> pos(x+ICON_PLAYER_WIDTH, y+5, x+ICON_PLAYER_WIDTH, y+5);
core::stringw s=info[i].time.c_str(); core::stringw s=info[i].m_text.c_str();
font->draw(s.c_str(), pos, color); font->draw(s.c_str(), pos, color);
} }

@ -44,11 +44,16 @@ public:
*/ */
struct KartIconDisplayInfo struct KartIconDisplayInfo
{ {
irr::core::stringw time; /** text to display next to icon, if any */
irr::core::stringw m_text;
/** text color, if any text */
float r, g, b; float r, g, b;
/** if this kart has a special title, e.g. "leader" in follow-the-leader */
irr::core::stringw special_title; irr::core::stringw special_title;
/** Current lap of this kart, or -1 if irrelevant
*/ /** Current lap of this kart, or -1 if irrelevant */
int lap; int lap;
}; // KartIconDisplayInfo }; // KartIconDisplayInfo