mirror of
https://github.com/shadowfacts/jinput-arm64.git
synced 2025-12-06 08:01:59 +01:00
Merge revision 12 of oddlabs svn repo.
Mac OS X: build.xml fix Windows: Fixed crash when Raw plugin fails to load Mac OS X: Tweak native libraries so only one library, libjinput-osx.jnilib contains both gcc 3 ppc code and gcc 4 i386 code. That way, we'll cover all releases and architectures with one native library instead of two
This commit is contained in:
parent
559c008a02
commit
1dc8f9ea11
|
|
@ -144,11 +144,7 @@ class DefaultControllerEnvironment extends ControllerEnvironment {
|
||||||
ControllerEnvironment ce = (ControllerEnvironment) ceClass.newInstance();
|
ControllerEnvironment ce = (ControllerEnvironment) ceClass.newInstance();
|
||||||
addControllers(ce.getControllers());
|
addControllers(ce.getControllers());
|
||||||
}
|
}
|
||||||
} catch (InstantiationException e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IllegalAccessException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,15 @@
|
||||||
<description>OSX JInput Native Plugin</description>
|
<description>OSX JInput Native Plugin</description>
|
||||||
|
|
||||||
<target name="init">
|
<target name="init">
|
||||||
<mkdir dir="universal"/>
|
<mkdir dir="ppc"/>
|
||||||
<mkdir dir="legacy"/>
|
<mkdir dir="intel"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="clean">
|
<target name="clean">
|
||||||
<delete failonerror="false">
|
<delete failonerror="false">
|
||||||
<fileset dir="universal"/>
|
<fileset dir="intel"/>
|
||||||
<fileset dir="legacy"/>
|
<fileset dir="ppc"/>
|
||||||
|
<fileset file="libjinput-osx.jnilib"/>
|
||||||
</delete>
|
</delete>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
|
@ -24,44 +25,51 @@
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="link">
|
<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"/>
|
<arg line="${linkerflags} -dynamiclib -o ${libname} -framework JavaVM -framework CoreFoundation -framework IOKit -framework CoreServices"/>
|
||||||
<fileset dir="${objdir}" includes="*.o"/>
|
<fileset dir="${objdir}" includes="*.o"/>
|
||||||
</apply>
|
</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"/>
|
<arg line="-S -X"/>
|
||||||
<fileset dir="." includes="*.jnilib"/>
|
<fileset dir="." includes="${libname}"/>
|
||||||
</apply>
|
</apply>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="compileNativeJinputLib" depends="init">
|
<target name="compileNativeJinputLib" depends="init">
|
||||||
<property name="universal_sdkroot" location="/Developer/SDKs/MacOSX10.4u.sdk"/>
|
<property name="universal_sdkroot" location="/Developer/SDKs/MacOSX10.4u.sdk"/>
|
||||||
<property name="legacy_sdkroot" location="/Developer/SDKs/MacOSX10.3.9.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">
|
<antcall target="compile">
|
||||||
<param name="dstdir" location="universal"/>
|
<param name="dstdir" location="intel"/>
|
||||||
<param name="compiler" value="gcc-4.0"/>
|
<param name="compiler" value="gcc-4.0"/>
|
||||||
<param name="sdkroot" location="${universal_sdkroot}"/>
|
<param name="sdkroot" location="${universal_sdkroot}"/>
|
||||||
<param name="cflags" value="${universal_flags}"/>
|
<param name="cflags" value="${universal_flags}"/>
|
||||||
</antcall>
|
</antcall>
|
||||||
<antcall target="link">
|
<antcall target="link">
|
||||||
<param name="objdir" location="universal"/>
|
<param name="objdir" location="intel"/>
|
||||||
<param name="libname" value="libjinput-osx.jnilib"/>
|
<param name="libname" value="libjinput-osx-intel.jnilib"/>
|
||||||
<param name="linker" value="gcc-4.0"/>
|
<param name="linker" value="gcc-4.0"/>
|
||||||
<!-- <param name="linkerflags" value="${universal_flags} -Wl,-syslibroot,${universal_sdkroot}"/>-->
|
|
||||||
<param name="linkerflags" value="${universal_flags}"/>
|
<param name="linkerflags" value="${universal_flags}"/>
|
||||||
</antcall>
|
</antcall>
|
||||||
<antcall target="compile">
|
<antcall target="compile">
|
||||||
<param name="dstdir" location="legacy"/>
|
<param name="dstdir" location="ppc"/>
|
||||||
<param name="compiler" value="gcc-3.3"/>
|
<param name="compiler" value="gcc-3.3"/>
|
||||||
<param name="sdkroot" location="${legacy_sdkroot}"/>
|
<param name="sdkroot" location="${legacy_sdkroot}"/>
|
||||||
<param name="cflags" value=""/>
|
<param name="cflags" value=""/>
|
||||||
</antcall>
|
</antcall>
|
||||||
<antcall target="link">
|
<antcall target="link">
|
||||||
<param name="objdir" location="legacy"/>
|
<param name="objdir" location="ppc"/>
|
||||||
<param name="libname" value="libjinput-osx-legacy.jnilib"/>
|
<param name="libname" value="libjinput-osx-ppc.jnilib"/>
|
||||||
<param name="linker" value="gcc-3.3"/>
|
<param name="linker" value="gcc-3.3"/>
|
||||||
<param name="linkerflags" value=""/>
|
<param name="linkerflags" value=""/>
|
||||||
</antcall>
|
</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>
|
</target>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,8 @@ public final class DirectInputEnvironmentPlugin extends ControllerEnvironment im
|
||||||
for (int i = 0; i < device_objects.size(); i++) {
|
for (int i = 0; i < device_objects.size(); i++) {
|
||||||
DIDeviceObject device_object = (DIDeviceObject)device_objects.get(i);
|
DIDeviceObject device_object = (DIDeviceObject)device_objects.get(i);
|
||||||
Component.Identifier identifier = device_object.getIdentifier();
|
Component.Identifier identifier = device_object.getIdentifier();
|
||||||
|
if (identifier == null)
|
||||||
|
continue;
|
||||||
if (map_mouse_buttons && identifier instanceof Component.Identifier.Button) {
|
if (map_mouse_buttons && identifier instanceof Component.Identifier.Button) {
|
||||||
identifier = DIIdentifierMap.mapMouseButtonIdentifier((Component.Identifier.Button)identifier);
|
identifier = DIIdentifierMap.mapMouseButtonIdentifier((Component.Identifier.Button)identifier);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue