Win32 buildfix and warning fix.

I don't know how many pads are supposed to be supported, but I went with a reasonable number until the proper amount is committed.
This commit is contained in:
The Dax 2014-06-01 18:25:35 -04:00
parent 62aafbbf48
commit 9672701743
2 changed files with 4 additions and 2 deletions

View file

@ -143,6 +143,8 @@ DinputDevice::DinputDevice(int devnum) {
return;
}
const int MAX_NUM_PADS = 4;
if (devnum >= MAX_NUM_PADS)
{
return;
@ -318,7 +320,7 @@ void DinputDevice::ApplyButtons(DIJOYSTATE2 &state, InputState &input_state) {
}
}
int DinputDevice::getNumPads()
size_t DinputDevice::getNumPads()
{
if (devices.empty())
{

View file

@ -32,7 +32,7 @@ public:
~DinputDevice();
virtual int UpdateState(InputState &input_state);
virtual bool IsPad() { return true; }
static int getNumPads();
static size_t getNumPads();
private:
void ApplyButtons(DIJOYSTATE2 &state, InputState &input_state);
//unfortunate and unclean way to keep only one DirectInput instance around