Fixes to solve issue 21

This commit is contained in:
endolf 2003-10-20 18:41:26 +00:00
parent b9346a6a83
commit a8cbd46c50
2 changed files with 7 additions and 2 deletions

View file

@ -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);
}

View file

@ -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;
}