Skip to content

Commit dc467cf

Browse files
Try to fix #5207
m_icons_frame texture pointer should be retrieved again after sameRestart
1 parent 7ced6da commit dc467cf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/states_screens/race_result_gui.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -1425,19 +1425,20 @@ void RaceResultGUI::displayOneEntry(unsigned int x, unsigned int y,
14251425
}
14261426

14271427
// Draw kart color circle if kart has custom color
1428-
if (m_icons_frame && ri->m_kart_color > 0.0)
1428+
video::ITexture* icons_frame = irr_driver->getTexture("icons-frame.png");
1429+
if (ri->m_kart_color > 0.0)
14291430
{
14301431
const video::SColorHSL kart_colorHSL(ri->m_kart_color * 360.0, 80.0, 50.0);
14311432
video::SColorf kart_colorf;
14321433
kart_colorHSL.toRGB(kart_colorf);
14331434
const video::SColor kart_color = kart_colorf.toSColor();
14341435
const video::SColor colors[4] = {kart_color, kart_color, kart_color, kart_color};
1435-
const core::recti source_rect(core::vector2di(0, 0), m_icons_frame->getSize());
1436+
const core::recti source_rect(core::vector2di(0, 0), icons_frame->getSize());
14361437
// make frame bigger than icon to make color visible for all cases
14371438
const int extra_width = std::max((unsigned int)5, m_width_icon / 8);
14381439
core::recti dest_rect(current_x - extra_width, y - extra_width,
14391440
current_x + m_width_icon + extra_width, y + m_width_icon + extra_width);
1440-
draw2DImage(m_icons_frame, dest_rect, source_rect, NULL, colors, true);
1441+
draw2DImage(icons_frame, dest_rect, source_rect, NULL, colors, true);
14411442
}
14421443
// First draw the icon
14431444
// -------------------

0 commit comments

Comments
 (0)