#else
const char* icon_fname = "images/engine/icons/supertux.xpm";
#endif
- SDL_Surface* icon = IMG_Load_RW(get_physfs_SDLRWops(icon_fname), true);
+ SDL_Surface* icon;
+ try {
+ icon = IMG_Load_RW(get_physfs_SDLRWops(icon_fname), true);
+ } catch (const std::runtime_error& err) {
+ icon = 0;
+ log_warning << "Couldn't load icon '" << icon_fname << "': " << err.what() << std::endl;
+ }
if(icon != 0) {
SDL_WM_SetIcon(icon, 0);
SDL_FreeSurface(icon);
}
#ifdef DEBUG
else {
- log_warning << "Couldn't find icon '" << icon_fname << "'" << std::endl;
+ log_warning << "Couldn't load icon '" << icon_fname << "'" << std::endl;
}
#endif