Skip to content

Commit

Permalink
Undo name change for the controller list
Browse files Browse the repository at this point in the history
(cherry picked from commit f60622c)
  • Loading branch information
slouken committed May 19, 2023
1 parent 43b12fd commit beca414
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/joystick/controller_list.h
Expand Up @@ -19,7 +19,7 @@
*/
#define MAKE_CONTROLLER_ID( nVID, nPID ) (unsigned int)( (unsigned int)nVID << 16 | (unsigned int)nPID )

static const ControllerDescription_t SDL_controller_list[] = {
static const ControllerDescription_t arrControllers[] = {
{ MAKE_CONTROLLER_ID( 0x0079, 0x181a ), k_eControllerType_PS3Controller, NULL }, // Venom Arcade Stick
{ MAKE_CONTROLLER_ID( 0x0079, 0x1844 ), k_eControllerType_PS3Controller, NULL }, // From SDL
{ MAKE_CONTROLLER_ID( 0x044f, 0xb315 ), k_eControllerType_PS3Controller, NULL }, // Firestorm Dual Analog 3
Expand Down
20 changes: 10 additions & 10 deletions src/joystick/controller_type.c
Expand Up @@ -61,13 +61,13 @@ EControllerType GuessControllerType( int nVID, int nPID )
{
s_bCheckedForDuplicates = true;
int i, j;
for ( i = 0; i < sizeof( SDL_controller_list ) / sizeof( SDL_controller_list[ 0 ] ); ++i )
for ( i = 0; i < sizeof( arrControllers ) / sizeof( arrControllers[ 0 ] ); ++i )
{
for ( j = i + 1; j < sizeof( SDL_controller_list ) / sizeof( SDL_controller_list[ 0 ] ); ++j )
for ( j = i + 1; j < sizeof( arrControllers ) / sizeof( arrControllers[ 0 ] ); ++j )
{
if ( SDL_controller_list[ i ].m_unDeviceID == SDL_controller_list[ j ].m_unDeviceID )
if ( arrControllers[ i ].m_unDeviceID == arrControllers[ j ].m_unDeviceID )
{
Log( "Duplicate controller entry found for VID 0x%.4x PID 0x%.4x\n", ( SDL_controller_list[ i ].m_unDeviceID >> 16 ), SDL_controller_list[ i ].m_unDeviceID & 0xFFFF );
Log( "Duplicate controller entry found for VID 0x%.4x PID 0x%.4x\n", ( arrControllers[ i ].m_unDeviceID >> 16 ), arrControllers[ i ].m_unDeviceID & 0xFFFF );
}
}
}
Expand Down Expand Up @@ -111,11 +111,11 @@ EControllerType GuessControllerType( int nVID, int nPID )
return k_eControllerType_UnknownNonSteamController;
}

for ( iIndex = 0; iIndex < sizeof( SDL_controller_list ) / sizeof( SDL_controller_list[0] ); ++iIndex )
for ( iIndex = 0; iIndex < sizeof( arrControllers ) / sizeof( arrControllers[0] ); ++iIndex )
{
if ( unDeviceID == SDL_controller_list[ iIndex ].m_unDeviceID )
if ( unDeviceID == arrControllers[ iIndex ].m_unDeviceID )
{
return SDL_controller_list[ iIndex ].m_eControllerType;
return arrControllers[ iIndex ].m_eControllerType;
}
}

Expand All @@ -127,11 +127,11 @@ const char *GuessControllerName( int nVID, int nPID )
{
unsigned int unDeviceID = MAKE_CONTROLLER_ID( nVID, nPID );
int iIndex;
for ( iIndex = 0; iIndex < sizeof( SDL_controller_list ) / sizeof( SDL_controller_list[0] ); ++iIndex )
for ( iIndex = 0; iIndex < sizeof( arrControllers ) / sizeof( arrControllers[0] ); ++iIndex )
{
if ( unDeviceID == SDL_controller_list[ iIndex ].m_unDeviceID )
if ( unDeviceID == arrControllers[ iIndex ].m_unDeviceID )
{
return SDL_controller_list[ iIndex ].m_pszName;
return arrControllers[ iIndex ].m_pszName;
}
}

Expand Down

0 comments on commit beca414

Please sign in to comment.