[PD-cvs] externals/hcs/rawhid rawjoystick.c,1.3,1.4

eighthave at users.sourceforge.net eighthave at users.sourceforge.net
Mon Oct 20 18:17:54 CEST 2003


Update of /cvsroot/pure-data/externals/hcs/rawhid
In directory sc8-pr-cvs1:/tmp/cvs-serv5116

Modified Files:
	rawjoystick.c 
Log Message:
allowed more init errors through; changed version message

Index: rawjoystick.c
===================================================================
RCS file: /cvsroot/pure-data/externals/hcs/rawhid/rawjoystick.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** rawjoystick.c	12 Oct 2003 16:26:39 -0000	1.3
--- rawjoystick.c	20 Oct 2003 16:17:52 -0000	1.4
***************
*** 23,26 ****
--- 23,27 ----
   * -figure out why it takes so long for [rawjoystick] to start
   * -get throttle and twist working 
+  * -use SDL_PumpEvent rather than SDL_PollEvent in _read
   */
  static char *version = "$Revision$";
***************
*** 28,32 ****
  #include <SDL/SDL.h>
  #include <m_pd.h>
- #include "m_imp.h"
  
  #define DEBUG(x)
--- 29,32 ----
***************
*** 71,79 ****
  
      if ( SDL_JoystickOpened(x->x_devnum) ) {
!       SDL_JoystickClose(x->x_joystick);
        return 1;
      }
      else {	 
!       return 0;
      }
  }
--- 71,80 ----
  
      if ( SDL_JoystickOpened(x->x_devnum) ) {
! 		 SDL_JoystickClose(x->x_joystick);
        return 1;
      }
      else {	 
! 		 post("ERROR: joystick not closed!!");
! 		 return 0;
      }
  }
***************
*** 91,98 ****
    /* get name of device */  
    if ( SDL_JoystickOpened(x->x_devnum) ) {
!     post ("Configuring %s",SDL_JoystickName(x->x_devnum));
    }
    else {	 
!     return 0;
    }
  
--- 92,100 ----
    /* get name of device */  
    if ( SDL_JoystickOpened(x->x_devnum) ) {
! 	  post ("Configuring %s",SDL_JoystickName(x->x_devnum));
    }
    else {	 
! 	  post("ERROR: joystick not opened!!");
! 	  return 0;
    }
  
***************
*** 232,237 ****
  
    DEBUG(post("rawjoystick_NEW"));
!   post("rawHID objects, %s", version);
!   post("       by Hans-Christoph Steiner <hans at eds.org>");
  
    /* init vars */
--- 234,238 ----
  
    DEBUG(post("rawjoystick_NEW"));
!   post("rawHID(e) rawjoystick %s, <hans at eds.org>", version);
  
    /* init vars */
***************
*** 245,252 ****
    /* INIT SDL using joystick layer  */  
    /* Note: Video is required to start Event Loop !! */
!   if ( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK) == -1 ) { 
!     post("Could not initialize SDL: %s.\n", SDL_GetError());
!     // exit(-1);
! 	return (0);	/* changed by olafmatt */
    }    
  
--- 246,253 ----
    /* INIT SDL using joystick layer  */  
    /* Note: Video is required to start Event Loop !! */
!   if ( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK) < 0 ) { 
! 	  post("Could not initialize SDL: %s\n", SDL_GetError());
! 	  // exit(-1);
! 	  return (0);	/* changed by olafmatt */
    }    
  






More information about the Pd-cvs mailing list