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@ ...@@ -15,6 +15,6 @@ AM_LDFLAGS = @WX_LIBS@
magicseteditor_SOURCES = 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; 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) { ...@@ -116,7 +116,7 @@ wxIcon load_resource_icon(const String& name) {
#if defined(__WXMSW__) #if defined(__WXMSW__)
return wxIcon(_("icon/") + name); return wxIcon(_("icon/") + name);
#else #else
static String path = wxStandardPaths::Get().GetDataDir() + _("/icon/"); static String path = wxStandardPaths::Get().GetDataDir() + _("/resource/icon/");
return wxIcon(path + name + _(".ico"), wxBITMAP_TYPE_ICO); return wxIcon(path + name + _(".ico"), wxBITMAP_TYPE_ICO);
#endif #endif
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
// -------------------------------------------------------- : Icons // -------------------------------------------------------- : 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/export ICON "icon/set.ico" //todo
icon/game ICON "icon/set.ico" //todo icon/game ICON "icon/set.ico" //todo
icon/set ICON "icon/set.ico" icon/set ICON "icon/set.ico"
...@@ -163,7 +163,7 @@ FILETYPE VFT_APP ...@@ -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 "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 "FileDescription", "Magic Set Editor"
VALUE "InternalName", "mse2/8" VALUE "InternalName", "mse2/8"
VALUE "LegalCopyright", " 2001-2007 Twan van Laarhoven" VALUE "LegalCopyright", " 2001-2007 Twan van Laarhoven"
VALUE "ProductName", "Magic Set Editor" VALUE "ProductName", "Magic Set Editor"
} }
} }
......
...@@ -33,16 +33,21 @@ Image ScriptableImage::generate(const GeneratedImage::Options& options, bool cac ...@@ -33,16 +33,21 @@ Image ScriptableImage::generate(const GeneratedImage::Options& options, bool cac
// cached, so we are done // cached, so we are done
return cached; return cached;
} }
// generate // generate blank image
Image image; Image image(1,1);
image.InitAlpha();
image.SetAlpha(0,0,0);
if (isReady()) { if (isReady()) {
image = value->generate(options); try {
} else { image = value->generate(options);
// error, return blank image }
Image i(1,1); catch (FileNotFoundError e) {
i.InitAlpha(); handle_error (e);
i.SetAlpha(0,0,0); return image;
image = i; }
}
else {
return image;
} }
// resize? // resize?
int iw = image.GetWidth(), ih = image.GetHeight(); 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