diff options
-rw-r--r-- | plugins/DX8/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java | 5 | ||||
-rw-r--r-- | plugins/DX8/src/native/input.cpp | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/plugins/DX8/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java b/plugins/DX8/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java index a406b09..fcaa278 100644 --- a/plugins/DX8/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java +++ b/plugins/DX8/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java @@ -162,7 +162,10 @@ public class DirectInputEnvironmentPlugin extends ControllerEnvironment c = DirectInputKeyboard.createKeyboard(lpDevice, subtype, productName, instanceName); } else { - assert category == DI8DEVTYPE_JOYSTICK; + // commented out the assert as we have already got devices that are + // gamepad type, but wr are still going to create them as + // DirectInputDevices + //assert category == DI8DEVTYPE_JOYSTICK; c = DirectInputDevice.createDevice(lpDevice, subtype, productName, instanceName,polled); } diff --git a/plugins/DX8/src/native/input.cpp b/plugins/DX8/src/native/input.cpp index 90281c8..b667f1d 100644 --- a/plugins/DX8/src/native/input.cpp +++ b/plugins/DX8/src/native/input.cpp @@ -534,7 +534,9 @@ Java_net_java_games_input_DirectInputDevice_pollNative // Poll the device if (pollme == JNI_TRUE) { res = lpDevice->Poll(); - if (res != DI_OK) { + // Changed this to FAILED(res) instead of res != DI_OK as it was + // causeing problems and the dx samples check for FAILED too. + if ( FAILED(res) ) { PrintDIError("Poll", res); return JNI_FALSE; } |