- bugfix, added a check to map editor and g3d viewer for ico file existance before trying to load the ico file

This commit is contained in:
Mark Vejvoda 2010-10-07 18:13:17 +00:00
parent e58055dfad
commit e400f449d6
2 changed files with 10 additions and 2 deletions

View File

@ -128,7 +128,11 @@ MainWindow::MainWindow(const string &modelPath)
#else
//std::cout << "B" << std::endl;
wxIcon icon;
icon.LoadFile(wxT("g3dviewer.ico"),wxBITMAP_TYPE_ICO);
std::ifstream testFile("g3dviewer.ico");
if(testFile.good()) {
testFile.close();
icon.LoadFile(wxT("g3dviewer.ico"),wxBITMAP_TYPE_ICO);
}
#endif
//std::cout << "C" << std::endl;
SetIcon(icon);

View File

@ -299,7 +299,11 @@ MainWindow::MainWindow()
#else
//std::cout << "B" << std::endl;
wxIcon icon;
icon.LoadFile(wxT("editor.ico"),wxBITMAP_TYPE_ICO);
std::ifstream testFile("editor.ico");
if(testFile.good()) {
testFile.close();
icon.LoadFile(wxT("editor.ico"),wxBITMAP_TYPE_ICO);
}
#endif
//std::cout << "C" << std::endl;
SetIcon(icon);