Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Jul 2014 13:23:27 +0000 (UTC)
From:      Rene Ladan <rene@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r362435 - in head/x11-toolkits/plib: . files
Message-ID:  <201407211323.s6LDNREf031663@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rene
Date: Mon Jul 21 13:23:26 2014
New Revision: 362435
URL: http://svnweb.freebsd.org/changeset/ports/362435
QAT: https://qat.redports.org/buildarchive/r362435/

Log:
  - Fix min/max/center values of USB joysticks
  - Bump PORTREVISION
  
  PR:		189006
  Submitted by:	russo@bogodyn.org

Added:
  head/x11-toolkits/plib/files/patch-src__js__jsBSD.cxx   (contents, props changed)
Modified:
  head/x11-toolkits/plib/Makefile

Modified: head/x11-toolkits/plib/Makefile
==============================================================================
--- head/x11-toolkits/plib/Makefile	Mon Jul 21 13:19:24 2014	(r362434)
+++ head/x11-toolkits/plib/Makefile	Mon Jul 21 13:23:26 2014	(r362435)
@@ -3,7 +3,7 @@
 
 PORTNAME=	plib
 PORTVERSION=	1.8.5
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	x11-toolkits
 MASTER_SITES=	http://plib.sourceforge.net/dist/
 

Added: head/x11-toolkits/plib/files/patch-src__js__jsBSD.cxx
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/x11-toolkits/plib/files/patch-src__js__jsBSD.cxx	Mon Jul 21 13:23:26 2014	(r362435)
@@ -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 ;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407211323.s6LDNREf031663>