Added informative message when a texture can not be found before

aborting.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4438 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2010-01-11 23:56:16 +00:00
parent 70f5f1044b
commit b34f4d238b

View File

@ -116,7 +116,12 @@ void IconButtonWidget::setImage(const char* path_to_texture)
// texture not found, try with absolute path
m_texture = GUIEngine::getDriver()->getTexture(m_properties[PROP_ICON].c_str());
}
assert(m_texture != NULL);
if(!m_texture)
{
fprintf(stderr, "Texture '%s' not found - aborting.\n",
m_properties[PROP_ICON].c_str());
exit(-1);
}
m_texture_w = m_texture->getSize().Width;
m_texture_h = m_texture->getSize().Height;