mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 05:51:27 +12:00
USB: Replace if/else with switch
This commit is contained in:
parent
33d2b27b91
commit
7fba56f27b
1 changed files with 13 additions and 4 deletions
|
@ -870,7 +870,9 @@ void connect_usb_controller(u8 index, input::product_type type)
|
|||
|
||||
if (!already_connected)
|
||||
{
|
||||
if (type == input::product_type::guncon_3)
|
||||
switch (type)
|
||||
{
|
||||
case input::product_type::guncon_3:
|
||||
{
|
||||
if (!g_cfg_guncon3.load())
|
||||
{
|
||||
|
@ -881,8 +883,9 @@ void connect_usb_controller(u8 index, input::product_type type)
|
|||
std::shared_ptr<usb_device> dev = std::make_shared<usb_device_guncon3>(index, usbh->get_new_location());
|
||||
usbh->connect_usb_device(dev, true);
|
||||
usbh->pad_to_usb.emplace(index, std::pair(type, dev));
|
||||
break;
|
||||
}
|
||||
if (type == input::product_type::top_shot_elite)
|
||||
case input::product_type::top_shot_elite:
|
||||
{
|
||||
if (!g_cfg_topshotelite.load())
|
||||
{
|
||||
|
@ -893,8 +896,9 @@ void connect_usb_controller(u8 index, input::product_type type)
|
|||
std::shared_ptr<usb_device> dev = std::make_shared<usb_device_topshotelite>(index, usbh->get_new_location());
|
||||
usbh->connect_usb_device(dev, true);
|
||||
usbh->pad_to_usb.emplace(index, std::pair(type, dev));
|
||||
break;
|
||||
}
|
||||
if (type == input::product_type::top_shot_fearmaster)
|
||||
case input::product_type::top_shot_fearmaster:
|
||||
{
|
||||
if (!g_cfg_topshotfearmaster.load())
|
||||
{
|
||||
|
@ -905,13 +909,18 @@ void connect_usb_controller(u8 index, input::product_type type)
|
|||
std::shared_ptr<usb_device> dev = std::make_shared<usb_device_topshotfearmaster>(index, usbh->get_new_location());
|
||||
usbh->connect_usb_device(dev, true);
|
||||
usbh->pad_to_usb.emplace(index, std::pair(type, dev));
|
||||
break;
|
||||
}
|
||||
if (type == input::product_type::udraw_gametablet)
|
||||
case input::product_type::udraw_gametablet:
|
||||
{
|
||||
sys_usbd.success("Adding emulated uDraw GameTablet (controller %d)", index);
|
||||
std::shared_ptr<usb_device> dev = std::make_shared<usb_device_gametablet>(index, usbh->get_new_location());
|
||||
usbh->connect_usb_device(dev, true);
|
||||
usbh->pad_to_usb.emplace(index, std::pair(type, dev));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue