diff --git a/x11-toolkits/plib/Makefile b/x11-toolkits/plib/Makefile index cf1f52782bac..e93f0bf50a20 100644 --- a/x11-toolkits/plib/Makefile +++ b/x11-toolkits/plib/Makefile @@ -3,7 +3,7 @@ PORTNAME= plib PORTVERSION= 1.8.5 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= x11-toolkits MASTER_SITES= http://plib.sourceforge.net/dist/ diff --git a/x11-toolkits/plib/files/patch-src__js__jsBSD.cxx b/x11-toolkits/plib/files/patch-src__js__jsBSD.cxx new file mode 100644 index 000000000000..6f0b6b797f69 --- /dev/null +++ b/x11-toolkits/plib/files/patch-src__js__jsBSD.cxx @@ -0,0 +1,47 @@ +--- ./src/js/jsBSD.cxx.orig 2014-07-21 15:11:30.000000000 +0200 ++++ ./src/js/jsBSD.cxx 2014-07-21 15:11:30.000000000 +0200 +@@ -99,6 +99,8 @@ + // on every read of a USB device + int cache_buttons ; + float cache_axes [ _JS_MAX_AXES ] ; ++ float axes_minimum [ _JS_MAX_AXES ] ; ++ float axes_maximum [ _JS_MAX_AXES ] ; + }; + + // Idents lower than USB_IDENT_OFFSET are for analog joysticks. +@@ -196,9 +198,12 @@ + case HUG_Z: + case HUG_RZ: + case HUG_SLIDER: ++ case HUG_DIAL: + if (*num_axes < _JS_MAX_AXES) + { + os->axes_usage[*num_axes] = usage; ++ os->axes_minimum[*num_axes] = h.logical_minimum; ++ os->axes_maximum[*num_axes] = h.logical_maximum; + (*num_axes)++; + } + break; +@@ -324,9 +329,6 @@ + + for ( int i = 0 ; i < _JS_MAX_AXES ; i++ ) + { +- // We really should get this from the HID, but that data seems +- // to be quite unreliable for analog-to-USB converters. Punt for +- // now. + if ( os->axes_usage [ i ] == HUG_HAT_SWITCH ) + { + max [ i ] = 1.0f ; +@@ -335,9 +337,9 @@ + } + else + { +- max [ i ] = 255.0f ; +- center [ i ] = 127.0f ; +- min [ i ] = 0.0f ; ++ max [ i ] = os->axes_maximum [ i ]; ++ min [ i ] = os->axes_minimum [ i ]; ++ center [ i ] = (max [ i ] + min [ i ]) / 2.0 ; + } + dead_band [ i ] = 0.0f ; + saturate [ i ] = 1.0f ;