Fixed DoConfig
Turns out I never fixed the button order in the first place.
This commit is contained in:
parent
21d5ba34b0
commit
729540d2b8
1 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue