From 729540d2b8555142e18a8b6ddf650f0525a5d009 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Fri, 28 Jun 2019 18:51:28 +0100 Subject: [PATCH] Fixed DoConfig Turns out I never fixed the button order in the first place. --- DoConfig/DoConfig.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DoConfig/DoConfig.cpp b/DoConfig/DoConfig.cpp index d8cae819..fe19817c 100644 --- a/DoConfig/DoConfig.cpp +++ b/DoConfig/DoConfig.cpp @@ -111,8 +111,6 @@ void activatejoy(Fl_Widget*, void*){ } } -const unsigned int button_lookup[8] = {0, 1, 2, 5, 3, 4, 6, 7}; - void read_Config(){ std::fstream fd; fd.open("Config.dat", std::ios::in | std::ios::binary); @@ -141,7 +139,8 @@ void read_Config(){ for(char i=0;i<8;i++){ const unsigned long button = CharsToLong(config.buttons[i]); if(button<9 && button>0){ - joyRows[button_lookup[i]]->value(button-1); + const unsigned int button_lookup[6] = {0, 1, 2, 4, 5, 3}; + joyRows[i]->value(button_lookup[button-1]); } } } @@ -154,7 +153,8 @@ void write_Config(Fl_Widget*, void*){ LongToChars(displaychoice->value(), config.display); LongToChars(joychoice->value(), config.useJoy); for(char i =0;i<8;i++){ - LongToChars(joyRows[button_lookup[i]]->value()+1, config.buttons[i]); + const unsigned int button_lookup[6] = {0, 1, 2, 5, 3, 4}; + LongToChars(button_lookup[joyRows[i]->value()]+1, config.buttons[i]); } std::fstream fd; fd.open("Config.dat", std::ios::out | std::ios::binary);