"platforms/common/src/kernels/pme.cc" did not exist on "1f2b65da328aee0d040b9050a48636468c2cca51"
Commit 21e4b332 authored by Phillip Castaneda's avatar Phillip Castaneda
Browse files

Adding joy patch - perform more reads per capture

parent d9b8990a
......@@ -31,7 +31,7 @@ restrictions:
#include "OISPrereqs.h"
//! Max number of elements to collect from buffered input
#define JOY_BUFFERSIZE 10
#define JOY_BUFFERSIZE 64
namespace OIS
{
......
......@@ -95,9 +95,11 @@ void LinuxJoyStick::capture()
//We are in non blocking mode - we just read once, and try to fill up buffer
input_event js[JOY_BUFFERSIZE];
while(true)
{
int ret = read(mJoyStick, &js, sizeof(struct input_event) * JOY_BUFFERSIZE);
if( ret <= 0 )
return;
if( ret < 0 )
break;
//Determine how many whole events re read up
ret /= sizeof(struct input_event);
......@@ -190,13 +192,14 @@ void LinuxJoyStick::capture()
case EV_REL: //Relative Axes (Do any joystick actually have a relative axis?)
#ifdef OIS_LINUX_JOY_DEBUG
#ifdef OIS_LINUX_JOY_DEBUG
cout << "\nWarning: Relatives axes not supported yet" << endl;
#endif
#endif
break;
default: break;
}
}
}
//All axes and POVs are combined into one movement per pair per captured frame
if( mBuffered && mListener )
......
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