More workingness, now accepts locally-stored resources!

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1158 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
coppro
2008-08-21 04:06:50 +00:00
parent d13b721b41
commit ec63e3b18b
9 changed files with 155 additions and 33 deletions
+4 -2
View File
@@ -210,8 +210,10 @@ InputStreamP load_resource_text(const String& name) {
int len = ::SizeofResource(wxGetInstance(), hResource);
return new_shared2<wxMemoryInputStream>(data, len);
#else
static String path = wxStandardPaths::Get().GetDataDir() + _("/resource/") + name;
return new_shared1<wxFileInputStream>(path);
static String path = wxStandardPaths::Get().GetDataDir() + _("/resource/");
static String local_path = wxStandardPaths::Get().GetUserDataDir() + _("/resource/");
if (wxFileExists(path + name)) return new_shared1<wxFileInputStream>(path + name);
else return new_shared1<wxFileInputStream>(local_path + name);
#endif
}