Fixed wrong icon frame with arrow used in kart list

This commit is contained in:
Benau 2020-03-24 01:02:19 +08:00
parent f47b410d92
commit b2c741a4b5
2 changed files with 12 additions and 3 deletions

View File

@ -102,11 +102,17 @@ RaceGUIBase::RaceGUIBase()
{
m_icons_frame = irr_driver->getTexture("icons-frame.png");
}
m_icons_kart_list = irr_driver->getTexture("icons-frame.png");
if (!m_icons_frame)
{
Log::error("RaceGuiBase",
"Can't find 'icons-frame.png' texture, aborting.");
}
if (!m_icons_kart_list)
{
Log::error("RaceGuiBase",
"Can't find 'icons-frame.png' texture, aborting.");
}
m_gauge_full = irr_driver->getTexture(FileManager::GUI_ICON, "gauge_full.png");
m_gauge_full_bright = irr_driver->getTexture(FileManager::GUI_ICON, "gauge_full_bright.png");
@ -1036,7 +1042,7 @@ void RaceGUIBase::drawPlayerIcon(AbstractKart *kart, int x, int y, int w,
const core::rect<s32> pos(x, y, x+w, y+w);
//to bring to light the player's icon: add a background
if (is_local && m_icons_frame != NULL)
if (is_local && m_icons_kart_list != NULL)
{
video::SColor colors[4];
for (unsigned int i=0;i<4;i++)
@ -1046,8 +1052,8 @@ void RaceGUIBase::drawPlayerIcon(AbstractKart *kart, int x, int y, int w,
100+(int)(100*cosf(M_PI/2*i+World::getWorld()->getTime()*2)));
}
const core::rect<s32> rect(core::position2d<s32>(0,0),
m_icons_frame->getSize());
draw2DImage(m_icons_frame, pos, rect,NULL, colors, true);
m_icons_kart_list->getSize());
draw2DImage(m_icons_kart_list, pos, rect,NULL, colors, true);
}
// Fixes crash bug, why are certain icons not showing up?

View File

@ -190,6 +190,9 @@ protected:
/** The frame around player karts in the mini map. */
video::ITexture* m_icons_frame;
/** The frame around player karts in the kart list. */
video::ITexture* m_icons_kart_list;
/** Texture for the lap icon*/
video::ITexture* m_lap_flag;