Main repository of MikuMikuStudio
修訂 | 23b3ed60983cfbc0615a07ced8981f858f08d4c4 (tree) |
---|---|
時間 | 2013-09-03 23:48:03 |
作者 | kobayasi <kobayasi@pscn...> |
Commiter | kobayasi |
Fix jnilib loading problem.
@@ -72,16 +72,31 @@ public class Natives { | ||
72 | 72 | URL url = Thread.currentThread().getContextClassLoader().getResource(path); |
73 | 73 | |
74 | 74 | if (url == null) { |
75 | - if (!warning) { | |
76 | - logger.log(Level.WARNING, "Cannot locate native library: {0}/{1}", | |
77 | - new String[]{sysName, fullname}); | |
75 | + if (sysName.equals("macosx")) { | |
76 | + fullname = fullname.replace(".dylib", ".jnilib"); | |
77 | + String path2 = "native/" + sysName + "/" + fullname; | |
78 | + // logger.warning("retry "+path2); | |
79 | + url = Thread.currentThread().getContextClassLoader().getResource(path2); | |
80 | + if (url == null) { | |
81 | + if (!warning) { | |
82 | + logger.log(Level.WARNING, "Cannot locate native library: {0}/{1}", | |
83 | + new String[]{sysName, fullname}); | |
84 | + } | |
85 | + return; | |
86 | + } | |
87 | + } else { | |
88 | + if (!warning) { | |
89 | + logger.log(Level.WARNING, "Cannot locate native library: {0}/{1}", | |
90 | + new String[]{sysName, fullname}); | |
91 | + } | |
92 | + return; | |
78 | 93 | } |
79 | - return; | |
80 | 94 | } |
81 | 95 | |
82 | 96 | URLConnection conn = url.openConnection(); |
83 | 97 | InputStream in = conn.getInputStream(); |
84 | 98 | File targetFile = new File(workingDir, fullname); |
99 | + // logger.info("targetFile = "+targetFile.getPath()); | |
85 | 100 | if (targetFile.exists()){ |
86 | 101 | // OK, compare last modified date of this file to |
87 | 102 | // file in jar |
@@ -274,8 +289,8 @@ public class Natives { | ||
274 | 289 | if (needLWJGL) { |
275 | 290 | extractNativeLib("macosx", "lwjgl"); |
276 | 291 | } |
277 | -// if (needOAL) | |
278 | -// extractNativeLib("macosx", "openal"); | |
292 | + if (needOAL) | |
293 | + extractNativeLib("macosx", "openal"); | |
279 | 294 | if (needJInput) { |
280 | 295 | extractNativeLib("macosx", "jinput-osx"); |
281 | 296 | } |