diff options
author | endolf <[email protected]> | 2003-10-20 18:41:26 +0000 |
---|---|---|
committer | endolf <[email protected]> | 2003-10-20 18:41:26 +0000 |
commit | a5bbe6f39d743c92527925019748585527e204d1 (patch) | |
tree | 1906ac2a844aa5105cadb5b055200da6a434ea7c | |
parent | 9ddf7d0e2a26650b94566c42f97b7c8ac32466ed (diff) |
Fixes to solve issue 21
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@55 e343933a-64c8-49c5-92b1-88f2ce3e89e8
-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; } |