pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/SDL USB joystick: number axes in usual order (X,...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/9894adb12d9f
branches:  trunk
changeset: 476225:9894adb12d9f
user:      dillo <dillo%pkgsrc.org@localhost>
date:      Sat Jun 05 14:04:21 2004 +0000

description:
USB joystick: number axes in usual order (X, Y, ...), not in order
returned by device.  Makes joysticks that return Z before X usable.

diffstat:

 devel/SDL/Makefile         |   3 ++-
 devel/SDL/distinfo         |   4 ++--
 devel/SDL/patches/patch-aa |  43 ++++++++++++++++++++++++++++++++++++++++---
 3 files changed, 44 insertions(+), 6 deletions(-)

diffs (79 lines):

diff -r 6e9a28abe234 -r 9894adb12d9f devel/SDL/Makefile
--- a/devel/SDL/Makefile        Sat Jun 05 13:57:54 2004 +0000
+++ b/devel/SDL/Makefile        Sat Jun 05 14:04:21 2004 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.54 2004/02/14 17:21:36 jlam Exp $
+# $NetBSD: Makefile,v 1.55 2004/06/05 14:04:21 dillo Exp $
 #
 
 PKG_INSTALLATION_TYPES=        overwrite pkgviews
+PKGREVISION=1
 
 .include "Makefile.common"
 .include "../../mk/bsd.pkg.mk"
diff -r 6e9a28abe234 -r 9894adb12d9f devel/SDL/distinfo
--- a/devel/SDL/distinfo        Sat Jun 05 13:57:54 2004 +0000
+++ b/devel/SDL/distinfo        Sat Jun 05 14:04:21 2004 +0000
@@ -1,8 +1,8 @@
-$NetBSD: distinfo,v 1.27 2004/04/17 00:15:21 snj Exp $
+$NetBSD: distinfo,v 1.28 2004/06/05 14:04:21 dillo Exp $
 
 SHA1 (SDL-1.2.7.tar.gz) = 1a840c50668f230df9e9163ef1a282d9f3355383
 Size (SDL-1.2.7.tar.gz) = 2470936 bytes
-SHA1 (patch-aa) = 4511f3af35b824d8e1425b571a8c12e44e8ef46c
+SHA1 (patch-aa) = cf5b703aa2ea4c047cfd5ea93b4687382e667b27
 SHA1 (patch-ab) = 7effcc7f7f1856372692c147521888843810fed5
 SHA1 (patch-af) = f5e824addf308f9c467de02e3b262afbc0ef77c0
 SHA1 (patch-aj) = 02705ec01b70cbfef6520586d799dccd835352dc
diff -r 6e9a28abe234 -r 9894adb12d9f devel/SDL/patches/patch-aa
--- a/devel/SDL/patches/patch-aa        Sat Jun 05 13:57:54 2004 +0000
+++ b/devel/SDL/patches/patch-aa        Sat Jun 05 14:04:21 2004 +0000
@@ -1,8 +1,45 @@
-$NetBSD: patch-aa,v 1.5 2003/09/03 19:30:53 drochner Exp $
+$NetBSD: patch-aa,v 1.6 2004/06/05 14:04:21 dillo Exp $
 
---- src/joystick/bsd/SDL_sysjoystick.c.orig    2003-08-30 21:13:05.000000000 +0200
+--- src/joystick/bsd/SDL_sysjoystick.c.orig    2004-02-18 18:22:01.000000000 +0100
 +++ src/joystick/bsd/SDL_sysjoystick.c
-@@ -461,9 +461,9 @@ report_alloc(struct report *r, struct re
+@@ -238,6 +238,7 @@ SDL_SYS_JoystickOpen(SDL_Joystick *joy)
+       struct hid_data *hdata;
+       struct report *rep;
+       int fd;
++      int i;
+ 
+       fd = open(path, O_RDONLY);
+       if (fd == -1) {
+@@ -302,6 +303,8 @@ SDL_SYS_JoystickOpen(SDL_Joystick *joy)
+       joy->nbuttons = 0;
+       joy->nhats = 0;
+       joy->nballs = 0;
++      for (i=0; i<JOYAXE_count; i++)
++              hw->axis_map[i] = -1;
+ 
+       while (hid_get_item(hdata, &hitem) > 0) {
+               char *sp;
+@@ -328,8 +331,7 @@ SDL_SYS_JoystickOpen(SDL_Joystick *joy)
+                           unsigned usage = HID_USAGE(hitem.usage);
+                           int joyaxe = usage_to_joyaxe(usage);
+                           if (joyaxe >= 0) {
+-                              hw->axis_map[joyaxe] = joy->naxes;
+-                              joy->naxes++;
++                              hw->axis_map[joyaxe] = 1;
+                           } else if (usage == HUG_HAT_SWITCH) {
+                               joy->nhats++;
+                           }
+@@ -347,6 +349,9 @@ SDL_SYS_JoystickOpen(SDL_Joystick *joy)
+               }
+       }
+       hid_end_parse(hdata);
++      for (i=0; i<JOYAXE_count; i++)
++              if (hw->axis_map[i] > 0)
++                      hw->axis_map[i] = joy->naxes++;
+ 
+ usbend:
+       /* The poll blocks the event thread. */
+@@ -529,9 +534,9 @@ report_alloc(struct report *r, struct re
  #endif
  #else
  # ifdef USBHID_NEW



Home | Main Index | Thread Index | Old Index