Remove redundant check for controller 'Auto' type.

This commit is contained in:
Stephen Anthony 2019-03-09 20:04:51 -03:30
parent e61caf069b
commit 0e9915823d
2 changed files with 9 additions and 13 deletions

View File

@ -823,15 +823,13 @@ void Console::setControllers(const string& rommd5)
const uInt8* image = myCart->getImage(size);
const bool swappedPorts = myProperties.get(Console_SwapPorts) != "NO";
// try to detect controllers
// Try to detect controllers
if(image != nullptr || size != 0)
{
left = ControllerDetector::detectType(image, size, left,
!swappedPorts ? Controller::Left : Controller::Right,
myOSystem.settings());
!swappedPorts ? Controller::Left : Controller::Right, myOSystem.settings());
right = ControllerDetector::detectType(image, size, right,
!swappedPorts ? Controller::Right : Controller::Left,
myOSystem.settings());
!swappedPorts ? Controller::Right : Controller::Left, myOSystem.settings());
}
unique_ptr<Controller> leftC = getControllerPort(rommd5, left, Controller::Left),

View File

@ -138,14 +138,12 @@ void RomInfoWidget::parseProperties(const FilesystemNode& node)
if(node.exists() && !node.isDirectory() &&
(image = instance().openROM(node, md5, size)) != nullptr)
{
if(BSPF::equalsIgnoreCase(left, "AUTO"))
left = ControllerDetector::detectName(image.get(), size, left,
!swappedPorts ? Controller::Jack::Left : Controller::Jack::Right,
instance().settings());
if(BSPF::equalsIgnoreCase(right, "AUTO"))
right = ControllerDetector::detectName(image.get(), size, right,
!swappedPorts ? Controller::Jack::Right : Controller::Jack::Left,
instance().settings());
left = ControllerDetector::detectName(image.get(), size, left,
!swappedPorts ? Controller::Jack::Left : Controller::Jack::Right,
instance().settings());
right = ControllerDetector::detectName(image.get(), size, right,
!swappedPorts ? Controller::Jack::Right : Controller::Jack::Left,
instance().settings());
}
}
catch(const runtime_error&)