From 9672701743805b894327db82c7f3c214727415f6 Mon Sep 17 00:00:00 2001 From: The Dax Date: Sun, 1 Jun 2014 18:25:35 -0400 Subject: [PATCH] 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. --- Windows/DinputDevice.cpp | 4 +++- Windows/DinputDevice.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Windows/DinputDevice.cpp b/Windows/DinputDevice.cpp index f25559bc6c..518106258b 100644 --- a/Windows/DinputDevice.cpp +++ b/Windows/DinputDevice.cpp @@ -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()) { diff --git a/Windows/DinputDevice.h b/Windows/DinputDevice.h index e27bd66840..d3f56df9d1 100644 --- a/Windows/DinputDevice.h +++ b/Windows/DinputDevice.h @@ -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