Ignore:
Timestamp:
May 15, 2012, 2:24:09 PM (8 years ago)
Author:
sam
Message:

input: support up to 16 buttons in Xbox-like pads.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/platform/xbox/xboxinput.cpp

    r1358 r1394  
    5454        Stick *stick = Input::CreateStick();
    5555        stick->SetAxisCount(4);
    56         stick->SetButtonCount(0);
     56        stick->SetButtonCount(16);
    5757        m_data->m_joysticks.Push(i, stick);
    5858    }
     
    9595        m_data->m_joysticks[i].m2->SetAxis(2, (float)state.Gamepad.sThumbRX / 32768.f);
    9696        m_data->m_joysticks[i].m2->SetAxis(3, -(float)state.Gamepad.sThumbRY / 32768.f);
     97
     98        for (int b = 0; b < 16; b++)
     99            m_data->m_joysticks[i].m2->SetButton(b, ((uint16_t)(state.Gamepad.wButtons) >> b) & 1);
    97100    }
    98101#endif
Note: See TracChangeset for help on using the changeset viewer.