summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/Src/XInput_Util.cpp
diff options
context:
space:
mode:
authorluisr142004 <luisr142004@gmail.com>2010-06-05 01:38:22 +0000
committerluisr142004 <luisr142004@gmail.com>2010-06-05 01:38:22 +0000
commit2e783d976902ea1ce8d6558d3c49282dc644301a (patch)
treec0b8b046d69c92fdec0cc236a7f52c5ae09a3604 /Source/Core/InputCommon/Src/XInput_Util.cpp
parentc98f8a96d2d504d6d383a4dec6ec44c254ba41f0 (diff)
space changes, merge #defines, language fix, and code reorder/cleanup :P
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5614 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/InputCommon/Src/XInput_Util.cpp')
-rw-r--r--Source/Core/InputCommon/Src/XInput_Util.cpp31
1 files changed, 15 insertions, 16 deletions
diff --git a/Source/Core/InputCommon/Src/XInput_Util.cpp b/Source/Core/InputCommon/Src/XInput_Util.cpp
index 0e9d6f4b24..88e0d0e54c 100644
--- a/Source/Core/InputCommon/Src/XInput_Util.cpp
+++ b/Source/Core/InputCommon/Src/XInput_Util.cpp
@@ -48,9 +48,10 @@ namespace XInput
struct CONTROLER_STATE
{
- XINPUT_STATE state;
- bool bConnected;
+ XINPUT_STATE state;
+ bool bConnected;
};
+
CONTROLER_STATE g_Controllers[MAX_CONTROLLERS];
@@ -61,33 +62,32 @@ CONTROLER_STATE g_Controllers[MAX_CONTROLLERS];
we currently only try to connect to XInput device 0 */
void Init()
{
- // Init state
- //ZeroMemory( g_Controllers, sizeof( CONTROLER_STATE ) * MAX_CONTROLLERS );
+ // Init state
+ //ZeroMemory( g_Controllers, sizeof( CONTROLER_STATE ) * MAX_CONTROLLERS );
// Declaration
DWORD dwResult;
// Calculate the number of connected XInput devices
for( DWORD i = 0; i < MAX_CONTROLLERS; i++ )
- {
- // Simply get the state of the controller from XInput.
- dwResult = XInputGetState( i, &g_Controllers[i].state );
-
- if( dwResult == ERROR_SUCCESS )
- g_Controllers[i].bConnected = true;
- else
- g_Controllers[i].bConnected = false;
- }
+ {
+ // Simply get the state of the controller from XInput.
+ dwResult = XInputGetState( i, &g_Controllers[i].state );
-}
+ if( dwResult == ERROR_SUCCESS )
+ g_Controllers[i].bConnected = true;
+ else
+ g_Controllers[i].bConnected = false;
+ }
+}
// Get the trigger status
// -------------------
int GetXI(int Controller, int Button)
{
// Update the internal status
- DWORD dwResult;
+ DWORD dwResult;
dwResult = XInputGetState(Controller, &g_Controllers[Controller].state);
if (dwResult != ERROR_SUCCESS) return -1;
@@ -105,7 +105,6 @@ int GetXI(int Controller, int Button)
}
}
-
// Check if a certain controller is connected
// -------------------
bool IsConnected(int Controller)