Commit bd228a90 authored by cutealien's avatar cutealien

Merge branch releases/1.8 revisions 4997:5000 into trunk.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5001 dfc29bdd-3216-0410-991c-e03cc46cb475
parent cb812399
...@@ -1959,11 +1959,12 @@ void CIrrDeviceLinux::pollJoysticks() ...@@ -1959,11 +1959,12 @@ void CIrrDeviceLinux::pollJoysticks()
#ifdef __FreeBSD__ #ifdef __FreeBSD__
struct joystick js; struct joystick js;
if (read(info.fd, &js, JS_RETURN) == JS_RETURN) if (read(info.fd, &js, sizeof(js)) == sizeof(js))
{ {
info.persistentData.JoystickEvent.ButtonStates = js.buttons; /* should be a two-bit field */ info.persistentData.JoystickEvent.ButtonStates = js.b1 | (js.b2 << 1); /* should be a two-bit field */
info.persistentData.JoystickEvent.Axis[0] = js.x; /* X axis */ info.persistentData.JoystickEvent.Axis[0] = js.x; /* X axis */
info.persistentData.JoystickEvent.Axis[1] = js.y; /* Y axis */ info.persistentData.JoystickEvent.Axis[1] = js.y; /* Y axis */
}
#else #else
struct js_event event; struct js_event event;
while (sizeof(event) == read(info.fd, &event, sizeof(event))) while (sizeof(event) == read(info.fd, &event, sizeof(event)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment