- change natives extraction so it can find lwjgl natives from the default lwjgl distribution

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10958 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
experimental
nor..67 11 years ago
parent 6184e7ce1a
commit 469fa68b5c
  1. 23
      engine/src/desktop/com/jme3/system/Natives.java

@ -149,11 +149,30 @@ public final class Natives {
URL url = Thread.currentThread().getContextClassLoader().getResource(path);
if (url == null) {
// Also check for binaries that are not packed in folders by jme team, e.g. maven artifacts
if(url == null){
path = fullname;
if(sysName.equals("macosx") && !fullname.contains(".")){
path = path.replaceAll("dylib","jnilib");
}
url = Thread.currentThread().getContextClassLoader().getResource(path);
}
if(url == null){
if (!warning) {
logger.log(Level.WARNING, "Cannot locate native library: {0}/{1}",
logger.log(Level.WARNING, "Cannot locate native library in classpath: {0}/{1}",
new String[]{sysName, fullname});
}
// Still try loading the library without a filename, maybe it is
// accessible otherwise
try{
System.loadLibrary(name);
} catch(UnsatisfiedLinkError e){
if (!warning) {
logger.log(Level.WARNING, "Cannot load native library: {0}/{1}",
new String[]{sysName, fullname});
}
}
return;
}

Loading…
Cancel
Save