Ignore:
Timestamp:
May 10, 2012, 1:33:51 PM (11 years ago)
Author:
sam
Message:

win32: add an Xinput class for Xbox360 controllers, because they're not
properly detected using the generic SDL driver.

Location:
trunk/src/platform
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/platform/sdl/sdlapp.cpp

    r1241 r1361  
    2525#include "platform/sdl/sdlapp.h"
    2626#include "platform/sdl/sdlinput.h"
     27#if defined USE_D3D9
     28#   include "platform/d3d9/d3d9input.h"
     29#endif
    2730
    2831#if defined USE_SDL && defined USE_D3D9
     
    8790
    8891    /* Autoreleased objects */
     92#   if defined USE_D3D9
     93    /* Prefer D3d9 for joysticks on Windows, because the X360 pads are not
     94     * advertised with the proper number of axes. */
     95    new D3d9Input();
     96#   endif
    8997    new SdlInput();
    9098#endif
  • trunk/src/platform/sdl/sdlinput.cpp

    r1355 r1361  
    5959        /* Blacklist HDAPS, it's not a real joystick */
    6060        char const *name = SDL_JoystickName(i);
    61         if (strstr(name, "HDAPS"))
     61        if (strstr(name, "HDAPS")
     62#   if !defined USE_D3D9
     63             || strstr(name, "XBOX 360 For Windows")
     64#   endif
     65             || true)
    6266        {
    6367            SDL_JoystickClose(sdlstick);
     
    7074
    7175        /* It's possible to remap axes */
    72         if (strstr(name, "XBOX 360 For Windows"))
    73         {
    74             //stick->RemapAxis(4, 2);
    75             //stick->RemapAxis(2, 4);
    76         }
     76        //stick->RemapAxis(4, 2);
     77        //stick->RemapAxis(2, 4);
    7778
    7879        m_data->m_joysticks.Push(sdlstick, stick);
Note: See TracChangeset for help on using the changeset viewer.