Changeset 1361


Ignore:
Timestamp:
May 10, 2012, 1:33:51 PM (9 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
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Makefile.am

    r1358 r1361  
    2323    $(nacl_sources) \
    2424    $(sdl_sources) \
     25    $(d3d9_sources) \
    2526    $(android_sources) \
    2627    \
     
    5253    platform/sdl/sdlinput.cpp platform/sdl/sdlinput.h
    5354
     55d3d9_sources = \
     56    platform/xbox/xboxinput.cpp platform/xbox/xboxinput.h
     57
    5458if USE_NACL
    5559nacl_sources = \
  • 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);
  • trunk/win32/Lol.Vars.props

    r1210 r1361  
    3636    <D3d9Libs Condition="'$(Platform)'=='Win32'">$(DXSDK_DIR)\Lib\x86</D3d9Libs>
    3737    <D3d9Libs Condition="'$(Platform)'=='x64'">$(DXSDK_DIR)\Lib\x64</D3d9Libs>
    38     <D3d9Deps Condition="'$(Configuration)'=='Release'">d3d9.lib;d3dx9.lib</D3d9Deps>
    39     <D3d9Deps Condition="'$(Configuration)'=='Debug'">d3d9.lib;d3dx9d.lib</D3d9Deps>
     38    <D3d9Deps Condition="'$(Configuration)'=='Release'">d3d9.lib;d3dx9.lib;xinput.lib</D3d9Deps>
     39    <D3d9Deps Condition="'$(Configuration)'=='Debug'">d3d9.lib;d3dx9d.lib;xinput.lib</D3d9Deps>
    4040
    4141    <Win32Defines>HAVE_SDL_H;USE_SDL;USE_GDIPLUS;USE_D3D9</Win32Defines>
  • trunk/win32/lolcore.vcxproj

    r1358 r1361  
    109109    <ClCompile Include="..\src\math\vector.cpp" />
    110110    <ClCompile Include="..\src\platform.cpp" />
     111    <ClCompile Include="..\src\platform\d3d9\d3d9input.cpp" />
    111112    <ClCompile Include="..\src\platform\sdl\sdlapp.cpp" />
    112113    <ClCompile Include="..\src\platform\sdl\sdlinput.cpp" />
     
    168169    <ClInclude Include="..\src\numeric.h" />
    169170    <ClInclude Include="..\src\platform.h" />
     171    <ClInclude Include="..\src\platform\d3d9\d3d9input.h" />
    170172    <ClInclude Include="..\src\platform\sdl\sdlapp.h" />
    171173    <ClInclude Include="..\src\platform\sdl\sdlinput.h" />
  • trunk/win32/lolcore.vcxproj.filters

    r1358 r1361  
    4545      <UniqueIdentifier>{94992c0e-ebc5-4185-b766-323b06547dcf}</UniqueIdentifier>
    4646    </Filter>
     47    <Filter Include="src\platform\d3d9">
     48      <UniqueIdentifier>{a914e15d-3201-467a-a9c9-d7c5244b13ee}</UniqueIdentifier>
     49    </Filter>
    4750  </ItemGroup>
    4851  <ItemGroup>
     
    206209      <Filter>src\input</Filter>
    207210    </ClCompile>
     211    <ClCompile Include="..\src\platform\d3d9\d3d9input.cpp">
     212      <Filter>src\platform\d3d9</Filter>
     213    </ClCompile>
    208214  </ItemGroup>
    209215  <ItemGroup>
     
    388394      <Filter>src\input</Filter>
    389395    </ClInclude>
     396    <ClInclude Include="..\src\platform\d3d9\d3d9input.h">
     397      <Filter>src\platform\d3d9</Filter>
     398    </ClInclude>
    390399  </ItemGroup>
    391400</Project>
Note: See TracChangeset for help on using the changeset viewer.