mirror of https://github.com/stella-emu/stella.git
Minor optimization in creating controller device in Console.
This commit is contained in:
parent
21195c20cb
commit
0bc8a928f0
|
@ -713,7 +713,14 @@ void Console::setControllers(const string& rommd5)
|
|||
bool swapPaddles = myProperties.get(Controller_SwapPaddles) == "YES";
|
||||
|
||||
// Construct left controller
|
||||
if(left == "BOOSTERGRIP")
|
||||
if(left == "JOYSTICK")
|
||||
{
|
||||
// Already created in c'tor
|
||||
// We save some time by not looking at all the other types
|
||||
leftC = myLeftControl ? std::move(myLeftControl) :
|
||||
make_ptr<Joystick>(Controller::Left, myEvent, *mySystem);
|
||||
}
|
||||
else if(left == "BOOSTERGRIP")
|
||||
{
|
||||
leftC = make_ptr<BoosterGrip>(Controller::Left, myEvent, *mySystem);
|
||||
}
|
||||
|
@ -757,13 +764,16 @@ void Console::setControllers(const string& rommd5)
|
|||
{
|
||||
leftC = make_ptr<MindLink>(Controller::Left, myEvent, *mySystem);
|
||||
}
|
||||
else
|
||||
{
|
||||
leftC = make_ptr<Joystick>(Controller::Left, myEvent, *mySystem);
|
||||
}
|
||||
|
||||
// Construct right controller
|
||||
if(right == "BOOSTERGRIP")
|
||||
if(right == "JOYSTICK")
|
||||
{
|
||||
// Already created in c'tor
|
||||
// We save some time by not looking at all the other types
|
||||
rightC = myRightControl ? std::move(myRightControl) :
|
||||
make_ptr<Joystick>(Controller::Right, myEvent, *mySystem);
|
||||
}
|
||||
else if(right == "BOOSTERGRIP")
|
||||
{
|
||||
rightC = make_ptr<BoosterGrip>(Controller::Right, myEvent, *mySystem);
|
||||
}
|
||||
|
@ -824,10 +834,6 @@ void Console::setControllers(const string& rommd5)
|
|||
{
|
||||
rightC = make_ptr<MindLink>(Controller::Right, myEvent, *mySystem);
|
||||
}
|
||||
else
|
||||
{
|
||||
rightC = make_ptr<Joystick>(Controller::Right, myEvent, *mySystem);
|
||||
}
|
||||
|
||||
// Swap the ports if necessary
|
||||
if(myProperties.get(Console_SwapPorts) == "NO")
|
||||
|
|
Loading…
Reference in New Issue