From 29ba4ee543c307cc5d583a553968e943324b3ce9 Mon Sep 17 00:00:00 2001 From: Deve Date: Sat, 16 Sep 2017 23:38:26 +0200 Subject: [PATCH] Avoid a warning about missing texture in race result gui --- src/guiengine/widgets/icon_button_widget.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/guiengine/widgets/icon_button_widget.cpp b/src/guiengine/widgets/icon_button_widget.cpp index b4bd8ef0b..66934808f 100644 --- a/src/guiengine/widgets/icon_button_widget.cpp +++ b/src/guiengine/widgets/icon_button_widget.cpp @@ -65,15 +65,15 @@ void IconButtonWidget::add() // ---- Icon if (m_texture == NULL) { - if (m_icon_path_type == ICON_PATH_TYPE_ABSOLUTE) + // Avoid warning about missing texture in case of e.g. + // screenshot widget + if (m_properties[PROP_ICON] != "") { - setTexture(irr_driver->getTexture(m_properties[PROP_ICON])); - } - else if (m_icon_path_type == ICON_PATH_TYPE_RELATIVE) - { - // Avoid warning about missing texture in case of e.g. - // screenshot widget - if(m_properties[PROP_ICON] != "") + if (m_icon_path_type == ICON_PATH_TYPE_ABSOLUTE) + { + setTexture(irr_driver->getTexture(m_properties[PROP_ICON])); + } + else if (m_icon_path_type == ICON_PATH_TYPE_RELATIVE) { std::string file = file_manager->getAsset(m_properties[PROP_ICON]); setTexture(irr_driver->getTexture(file));