src/joystick/win32/SDL_dxjoystick.c
branchgsoc2008_force_feedback
changeset 2616 acd5da848404
parent 2580 64fa227c01ce
child 2623 6deba05725ac
     1.1 --- a/src/joystick/win32/SDL_dxjoystick.c	Wed Aug 06 07:59:03 2008 +0000
     1.2 +++ b/src/joystick/win32/SDL_dxjoystick.c	Wed Aug 06 08:47:35 2008 +0000
     1.3 @@ -38,20 +38,7 @@
     1.4  #include "SDL_joystick.h"
     1.5  #include "../SDL_sysjoystick.h"
     1.6  #include "../SDL_joystick_c.h"
     1.7 -
     1.8 -#define WIN32_LEAN_AND_MEAN
     1.9 -#include <windows.h>
    1.10 -
    1.11 -#define DIRECTINPUT_VERSION 0x0500
    1.12 -#include <dinput.h>
    1.13 -#ifdef _MSC_VER
    1.14 -    /* Used for the c_dfDIJoystick2 symbol (no imports are used) */
    1.15 -#   pragma comment (lib, "dinput.lib")
    1.16 -#endif
    1.17 -#include <dxerr.h>
    1.18 -#ifdef _MSC_VER
    1.19 -#   pragma comment (lib, "dxerr.lib")
    1.20 -#endif
    1.21 +#include "SDL_dxjoystick_c.h"
    1.22  
    1.23  /* an ISO hack for VisualC++ */
    1.24  #ifdef _MSC_VER
    1.25 @@ -60,7 +47,6 @@
    1.26  
    1.27  #define INPUT_QSIZE	32      /* Buffer up to 32 input messages */
    1.28  #define MAX_JOYSTICKS	8
    1.29 -#define MAX_INPUTS	256     /* each joystick can have up to 256 inputs */
    1.30  #define AXIS_MIN	-32768  /* minimum value for axis coordinate */
    1.31  #define AXIS_MAX	32767   /* maximum value for axis coordinate */
    1.32  #define JOY_AXIS_THRESHOLD	(((AXIS_MAX)-(AXIS_MIN))/100)   /* 1% motion */
    1.33 @@ -95,33 +81,6 @@
    1.34                                           Uint8 button, Uint8 state);
    1.35  
    1.36  
    1.37 -/* local types */
    1.38 -typedef enum Type
    1.39 -{ BUTTON, AXIS, HAT } Type;
    1.40 -
    1.41 -typedef struct input_t
    1.42 -{
    1.43 -    /* DirectInput offset for this input type: */
    1.44 -    DWORD ofs;
    1.45 -
    1.46 -    /* Button, axis or hat: */
    1.47 -    Type type;
    1.48 -
    1.49 -    /* SDL input offset: */
    1.50 -    Uint8 num;
    1.51 -} input_t;
    1.52 -
    1.53 -/* The private structure used to keep track of a joystick */
    1.54 -struct joystick_hwdata
    1.55 -{
    1.56 -    LPDIRECTINPUTDEVICE2 InputDevice;
    1.57 -    DIDEVCAPS Capabilities;
    1.58 -    int buffered;
    1.59 -
    1.60 -    input_t Inputs[MAX_INPUTS];
    1.61 -    int NumInputs;
    1.62 -};
    1.63 -
    1.64  /* Convert a DirectInput return code to a text message */
    1.65  static void
    1.66  SetDIerror(const char *function, HRESULT code)