Skip to content

Commit

Permalink
Simplify the generated XInput joystick name.
Browse files Browse the repository at this point in the history
  • Loading branch information
SiegeLordEx authored and SiegeLord committed Jan 23, 2025
1 parent 539db57 commit 5043b19
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/win/wjoyxi.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,7 @@ static void joyxi_init_joystick_info(ALLEGRO_JOYSTICK_XINPUT *xjoy)
// Source: https://github.com/xan105/node-xinput-ffi/blob/master/lib/util/HardwareID.js
static const char *joyxi_lookup_device_name(WORD vid, WORD pid)
{
ALLEGRO_DEBUG("Looking up name for joystick vendor: %d, product: %d\n", vid, pid);
if (vid == 0x045E) {
switch (pid) {
case 0x028E: return "Xbox360 Controller";
Expand Down Expand Up @@ -681,7 +682,7 @@ static void joyxi_set_name(ALLEGRO_JOYSTICK_XINPUT *xjoy)
if (device_name[0] != '\0')
sprintf(xjoy->name, device_name);
else
sprintf(xjoy->name, "XInput Joystick vendor: %x product: %x", xicapas.VendorId, xicapas.ProductId);
sprintf(xjoy->name, "XInput Joystick %d", (int)xjoy->index);
return;
}
}
Expand Down

0 comments on commit 5043b19

Please sign in to comment.