aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--coreAPI/src/java/net/java/games/input/DefaultControllerEnvironment.java6
-rw-r--r--plugins/OSX/src/native/build.xml38
-rw-r--r--plugins/windows/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java2
3 files changed, 26 insertions, 20 deletions
diff --git a/coreAPI/src/java/net/java/games/input/DefaultControllerEnvironment.java b/coreAPI/src/java/net/java/games/input/DefaultControllerEnvironment.java
index 39db61a..da1305e 100644
--- a/coreAPI/src/java/net/java/games/input/DefaultControllerEnvironment.java
+++ b/coreAPI/src/java/net/java/games/input/DefaultControllerEnvironment.java
@@ -144,11 +144,7 @@ class DefaultControllerEnvironment extends ControllerEnvironment {
ControllerEnvironment ce = (ControllerEnvironment) ceClass.newInstance();
addControllers(ce.getControllers());
}
- } catch (InstantiationException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (ClassNotFoundException e) {
+ } catch (Throwable e) {
e.printStackTrace();
}
}
diff --git a/plugins/OSX/src/native/build.xml b/plugins/OSX/src/native/build.xml
index 9b338da..4c1a4ce 100644
--- a/plugins/OSX/src/native/build.xml
+++ b/plugins/OSX/src/native/build.xml
@@ -3,14 +3,15 @@
<description>OSX JInput Native Plugin</description>
<target name="init">
- <mkdir dir="universal"/>
- <mkdir dir="legacy"/>
+ <mkdir dir="ppc"/>
+ <mkdir dir="intel"/>
</target>
<target name="clean">
<delete failonerror="false">
- <fileset dir="universal"/>
- <fileset dir="legacy"/>
+ <fileset dir="intel"/>
+ <fileset dir="ppc"/>
+ <fileset file="libjinput-osx.jnilib"/>
</delete>
</target>
@@ -24,44 +25,51 @@
</target>
<target name="link">
- <apply dir="." parallel="true" executable="${linker}" os="Mac OS X" failonerror="true">
+ <apply dir="${objdir}" parallel="true" executable="${linker}" os="Mac OS X" failonerror="true" skipemptyfilesets="true">
<arg line="${linkerflags} -dynamiclib -o ${libname} -framework JavaVM -framework CoreFoundation -framework IOKit -framework CoreServices"/>
<fileset dir="${objdir}" includes="*.o"/>
</apply>
- <apply dir="." parallel="true" executable="strip" os="Mac OS X" failonerror="true">
+ <apply dir="${objdir}" executable="strip" os="Mac OS X" failonerror="true">
<arg line="-S -X"/>
- <fileset dir="." includes="*.jnilib"/>
+ <fileset dir="." includes="${libname}"/>
</apply>
</target>
<target name="compileNativeJinputLib" depends="init">
<property name="universal_sdkroot" location="/Developer/SDKs/MacOSX10.4u.sdk"/>
<property name="legacy_sdkroot" location="/Developer/SDKs/MacOSX10.3.9.sdk"/>
- <property name="universal_flags" value="-isysroot ${universal_sdkroot} -arch i386 -arch ppc"/>
+ <property name="universal_flags" value="-isysroot ${universal_sdkroot} -arch i386"/>
<antcall target="compile">
- <param name="dstdir" location="universal"/>
+ <param name="dstdir" location="intel"/>
<param name="compiler" value="gcc-4.0"/>
<param name="sdkroot" location="${universal_sdkroot}"/>
<param name="cflags" value="${universal_flags}"/>
</antcall>
<antcall target="link">
- <param name="objdir" location="universal"/>
- <param name="libname" value="libjinput-osx.jnilib"/>
+ <param name="objdir" location="intel"/>
+ <param name="libname" value="libjinput-osx-intel.jnilib"/>
<param name="linker" value="gcc-4.0"/>
- <!-- <param name="linkerflags" value="${universal_flags} -Wl,-syslibroot,${universal_sdkroot}"/>-->
<param name="linkerflags" value="${universal_flags}"/>
</antcall>
<antcall target="compile">
- <param name="dstdir" location="legacy"/>
+ <param name="dstdir" location="ppc"/>
<param name="compiler" value="gcc-3.3"/>
<param name="sdkroot" location="${legacy_sdkroot}"/>
<param name="cflags" value=""/>
</antcall>
<antcall target="link">
- <param name="objdir" location="legacy"/>
- <param name="libname" value="libjinput-osx-legacy.jnilib"/>
+ <param name="objdir" location="ppc"/>
+ <param name="libname" value="libjinput-osx-ppc.jnilib"/>
<param name="linker" value="gcc-3.3"/>
<param name="linkerflags" value=""/>
</antcall>
+ <apply dir="." parallel="true" executable="lipo" os="Mac OS X" failonerror="true" skipemptyfilesets="true" >
+ <arg value="-create"/>
+ <srcfile/>
+ <arg value="-output"/>
+ <arg path="libjinput-osx.jnilib"/>
+ <fileset file="ppc/libjinput-osx-ppc.jnilib"/>
+ <fileset file="intel/libjinput-osx-intel.jnilib"/>
+ </apply>
</target>
</project>
diff --git a/plugins/windows/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java b/plugins/windows/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java
index a7fa563..e09286a 100644
--- a/plugins/windows/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java
+++ b/plugins/windows/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java
@@ -102,6 +102,8 @@ public final class DirectInputEnvironmentPlugin extends ControllerEnvironment im
for (int i = 0; i < device_objects.size(); i++) {
DIDeviceObject device_object = (DIDeviceObject)device_objects.get(i);
Component.Identifier identifier = device_object.getIdentifier();
+ if (identifier == null)
+ continue;
if (map_mouse_buttons && identifier instanceof Component.Identifier.Button) {
identifier = DIIdentifierMap.mapMouseButtonIdentifier((Component.Identifier.Button)identifier);
}