mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2024-11-27 14:08:39 +01:00
Implement the GamepadIndex functions.
This commit is contained in:
parent
9b9c440fbc
commit
31c1453d2b
1 changed files with 8 additions and 2 deletions
|
@ -746,7 +746,10 @@ void SetLEDColor( ControllerHandle_t controllerHandle, uint8 nColorR, uint8 nCol
|
||||||
int GetGamepadIndexForController( ControllerHandle_t ulControllerHandle )
|
int GetGamepadIndexForController( ControllerHandle_t ulControllerHandle )
|
||||||
{
|
{
|
||||||
PRINT_DEBUG("Steam_Controller::GetGamepadIndexForController\n");
|
PRINT_DEBUG("Steam_Controller::GetGamepadIndexForController\n");
|
||||||
return 0;
|
auto controller = controllers.find(ulControllerHandle);
|
||||||
|
if (controller == controllers.end()) return -1;
|
||||||
|
|
||||||
|
return ulControllerHandle - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -754,7 +757,10 @@ int GetGamepadIndexForController( ControllerHandle_t ulControllerHandle )
|
||||||
ControllerHandle_t GetControllerForGamepadIndex( int nIndex )
|
ControllerHandle_t GetControllerForGamepadIndex( int nIndex )
|
||||||
{
|
{
|
||||||
PRINT_DEBUG("Steam_Controller::GetControllerForGamepadIndex\n");
|
PRINT_DEBUG("Steam_Controller::GetControllerForGamepadIndex\n");
|
||||||
return 0;
|
ControllerHandle_t out = nIndex + 1;
|
||||||
|
auto controller = controllers.find(out);
|
||||||
|
if (controller == controllers.end()) return 0;
|
||||||
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue