Commit 4d7f4687 authored by coppro's avatar coppro

Prevented some crashes from uncaught exceptions

Moved mse.ico to app.ico
Fixed the Linux version of load_resource_icon().
parent 5e3a114f
......@@ -15,6 +15,6 @@ AM_LDFLAGS = @WX_LIBS@
magicseteditor_SOURCES =
# The script used to generate is MakeAM. " > Makefile.am;
# The script used to generate is MakeAM.sh " > Makefile.am;
find . -name *.cpp | sed "s/\./magicseteditor_SOURCES += ./" >> Makefile.am;
\ No newline at end of file
......@@ -116,7 +116,7 @@ wxIcon load_resource_icon(const String& name) {
#if defined(__WXMSW__)
return wxIcon(_("icon/") + name);
#else
static String path = wxStandardPaths::Get().GetDataDir() + _("/icon/");
static String path = wxStandardPaths::Get().GetDataDir() + _("/resource/icon/");
return wxIcon(path + name + _(".ico"), wxBITMAP_TYPE_ICO);
#endif
}
......
......@@ -8,7 +8,7 @@
// -------------------------------------------------------- : Icons
icon/app ICON "icon/mse.ico" // has to come first in alphabet!!
icon/app ICON "icon/app.ico" // has to come first in alphabet!!
icon/export ICON "icon/set.ico" //todo
icon/game ICON "icon/set.ico" //todo
icon/set ICON "icon/set.ico"
......@@ -163,7 +163,7 @@ FILETYPE VFT_APP
VALUE "License", "GNU General Public License 2 or later; This is free software, and you are welcome to redistribute it under certain conditions; See the help file for details"
VALUE "FileDescription", "Magic Set Editor"
VALUE "InternalName", "mse2/8"
VALUE "LegalCopyright", " 2001-2007 Twan van Laarhoven"
VALUE "LegalCopyright", " 2001-2007 Twan van Laarhoven"
VALUE "ProductName", "Magic Set Editor"
}
}
......
......@@ -33,16 +33,21 @@ Image ScriptableImage::generate(const GeneratedImage::Options& options, bool cac
// cached, so we are done
return cached;
}
// generate
Image image;
// generate blank image
Image image(1,1);
image.InitAlpha();
image.SetAlpha(0,0,0);
if (isReady()) {
image = value->generate(options);
} else {
// error, return blank image
Image i(1,1);
i.InitAlpha();
i.SetAlpha(0,0,0);
image = i;
try {
image = value->generate(options);
}
catch (FileNotFoundError e) {
handle_error (e);
return image;
}
}
else {
return image;
}
// resize?
int iw = image.GetWidth(), ih = image.GetHeight();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment