Try loading .gfx files if .swf failed to load

This commit is contained in:
lcdr
2021-11-19 13:03:23 +01:00
committed by Jindra Petřík
parent 38996cdef4
commit a339486467
+14 -3
View File
@@ -875,14 +875,25 @@ public class Main {
//ignore
}
} else {
File f = new File(new File(file).getParentFile(), url);
if (f.exists()) {
File swf = new File(new File(file).getParentFile(), url);
if (swf.exists()) {
try {
return open(new FileInputStream(f), f.getAbsolutePath(), f.getName());
return open(new FileInputStream(swf), swf.getAbsolutePath(), swf.getName());
} catch (Exception ex) {
//ignore
}
}
// try .gfx if .swf failed
if (url.endsWith(".swf")) {
File gfx = new File(new File(file).getParentFile(), url.substring(0, url.length()-4)+".gfx");
if (gfx.exists()) {
try {
return open(new FileInputStream(gfx), gfx.getAbsolutePath(), gfx.getName());
} catch (Exception ex) {
//ignore
}
}
}
}
Reference<SWF> ret = new Reference<>(null);
View.execInEventDispatch(new Runnable() {