Indentation and unused code cleanup

This commit is contained in:
Dimitris Panokostas 2019-02-09 01:39:49 +01:00
parent f1f64867b6
commit 2b5f278754
2 changed files with 43 additions and 67 deletions

View file

@ -821,7 +821,6 @@ static int init_joystick(void)
fill_blank_controller();
host_input_buttons[cpt] = default_controller_map;
//printf("Retroarch search for: >>%s<<\n",joystick_name[cpt]);
host_input_buttons[cpt].is_retroarch = true;
@ -876,11 +875,11 @@ static int init_joystick(void)
// invert on axes
host_input_buttons[cpt].lstick_axis_y_invert = find_retroarch_polarity("input_down_axis", control_config);
if (host_input_buttons[cpt].lstick_axis_y_invert == false)
if (!host_input_buttons[cpt].lstick_axis_y_invert)
host_input_buttons[cpt].lstick_axis_y_invert = find_retroarch_polarity("input_l_y_plus_axis", control_config);
host_input_buttons[cpt].lstick_axis_x_invert = find_retroarch_polarity("input_right_axis", control_config);
if (host_input_buttons[cpt].lstick_axis_x_invert == false)
if (!host_input_buttons[cpt].lstick_axis_x_invert)
host_input_buttons[cpt].lstick_axis_x_invert = find_retroarch_polarity("input_l_x_plus_axis", control_config);
host_input_buttons[cpt].rstick_axis_x_invert = find_retroarch_polarity("input_r_x_plus_axis", control_config);
@ -1353,14 +1352,11 @@ int input_get_default_joystick(struct uae_input_device* uid, const int num, int
}
}
//
// ASSIGN ALL INPUT EVENT ACTIONS, EITHER CUSTOM OR DEFAULT
//
// set up a temporary control layout/ called 'thismap'
struct joypad_map_layout thismap[4];
// here, we will fill thismap with defaults, if a custom value is not set.
// this will do a lot of the 'logic' of the original code.

View file

@ -160,39 +160,22 @@ public:
void action(const gcn::ActionEvent& actionEvent) override
{
if (actionEvent.getSource() == optPort0)
{
SelectedPort = 0;
}
else if (actionEvent.getSource() == optPort1)
{
SelectedPort = 1;
}
else if (actionEvent.getSource() == optPort2)
{
SelectedPort = 2;
}
else if (actionEvent.getSource() == optPort3)
{
SelectedPort = 3;
}
else if (actionEvent.getSource() == optMultiNone)
{
SelectedFunction = 0;
}
else if (actionEvent.getSource() == optMultiSelect)
{
SelectedFunction = 1;
}
else if (actionEvent.getSource() == optMultiLeft)
{
SelectedFunction = 2;
}
else if (actionEvent.getSource() == optMultiRight)
{
SelectedFunction = 3;
}
else if (actionEvent.getSource() == chkAnalogRemap)
changed_prefs.input_analog_remap = chkAnalogRemap->isSelected();
@ -203,7 +186,6 @@ public:
static GroupActionListener* grpActionListener;
class CustomActionListener : public gcn::ActionListener
{
public:
@ -330,7 +312,6 @@ public:
break;
}
// and here, we will scroll through the custom-map and
// push it into the currprefs config file
@ -514,7 +495,6 @@ void ExitPanelCustom()
//delete cboCustomAction[i];
}
delete lblPortInput;
delete txtPortInput;
delete lblRetroarch;