added DefaultControllerEnvironment.loadLibrary convenience method for plugins. It will also respect the new net.java.games.input.librarypath property for locating natives (useful for applets). Removed the mac os x jinput-osx-legacy library loading, as it is not necessary anymore with the combined 10.3/10.4 library

This commit is contained in:
elias 2006-07-03 11:59:10 +00:00
parent d5ea04d3af
commit 4306f119c2
5 changed files with 25 additions and 36 deletions

View file

@ -56,21 +56,7 @@ import java.security.PrivilegedAction;
*/
public final class OSXEnvironmentPlugin extends ControllerEnvironment implements Plugin {
static {
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
if (isMacOSXEqualsOrBetterThan(10, 4)) {
System.loadLibrary("jinput-osx");
} else {
// If we're not on 10.4 or later, try to load the legacy library first
try {
System.loadLibrary("jinput-osx-legacy");
} catch (UnsatisfiedLinkError e) {
System.loadLibrary("jinput-osx");
}
}
return null;
}
});
DefaultControllerEnvironment.loadLibrary("jinput-osx");
}
private final static boolean isMacOSXEqualsOrBetterThan(int major_required, int minor_required) {