Move getting team icons to avoid getting it in every refresh.

I'm not sure where it should be to keep order.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@13698 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
deveee 2013-09-16 10:15:29 +00:00
parent 9301bb41d6
commit 829656d1d7
2 changed files with 14 additions and 4 deletions

View File

@ -298,6 +298,14 @@ void RaceResultGUI::onConfirm()
*/
void RaceResultGUI::determineTableLayout()
{
if (race_manager->getMinorMode() == RaceManager::MINOR_MODE_SOCCER)
{
redTeamTexture = irr_driver->getTexture(
file_manager->getTextureFile("soccer_ball_red.png"));
blueTeamTexture = irr_driver->getTexture(
file_manager->getTextureFile("soccer_ball_blue.png"));
}
GUIEngine::Widget *table_area = getWidget("result-table");
m_font = GUIEngine::getFont();
@ -798,14 +806,12 @@ void RaceResultGUI::displayOneEntry(unsigned int x, unsigned int y,
if (m_team_goals[0] > m_team_goals[1])
{
text = core::stringw(_("Red team won"));
team_icon = irr_driver->getTexture(
file_manager->getTextureFile("soccer_ball_red.png"));
team_icon = redTeamTexture;
}
else if (m_team_goals[0] < m_team_goals[1])
{
text = core::stringw(_("Blue team won"));
team_icon = irr_driver->getTexture(
file_manager->getTextureFile("soccer_ball_blue.png"));
team_icon = blueTeamTexture;
}
else
text = core::stringw(_("Draw"));

View File

@ -109,6 +109,10 @@ private:
#endif
}; // Rowinfo
/** The team icons. */
video::ITexture *redTeamTexture;
video::ITexture *blueTeamTexture;
std::vector<RowInfo> m_all_row_infos;
/** Time to wait till the next row starts to be animated. */