![](/media/cache/profiles/LinkedIn_0NghoZJ.jpeg.50x50_q85.jpg)
Snake vs Block Game to be run upon K64F.
Diff: MenuClasses/Settings/Settings.cpp
- Revision:
- 55:df0825049171
- Parent:
- 49:441c32f6603e
- Child:
- 56:142e9fdb77a8
--- a/MenuClasses/Settings/Settings.cpp Fri Apr 26 19:32:57 2019 +0000 +++ b/MenuClasses/Settings/Settings.cpp Sat Apr 27 18:56:30 2019 +0000 @@ -52,40 +52,44 @@ wait(1/cs); lcd.clear(); - if((d==E)&&(st==5)) { - st=1; - } - else if((d==W)&&(st==1)) { - st=5; - } - else if((d==E)&&(1<=st<=4)) { - st=st+1; - } - else if((d==W)&&(2<=st<=5)) { - st=st-1; - } - lcd.drawSprite(5,22,13,8,(int *)naviL); //Function used to draw the sprite. - lcd.drawSprite(71,22,13,8,(int *)naviR); //Function used to draw the sprite. - if(st==1) { - Settings::controlSensitivity(lcd, pad); - } - if(st==2) { - Settings::brigntness(lcd, pad); - } - if(st==3) { - Settings::contrast(lcd, pad); - } - if(st==4) { - Settings::volume(lcd, pad); - } - if(st==5) { - Settings::showCredits(lcd, pad); - } - lcd.refresh(); + if((d==E)&&(st==5)) { st=1; } + + else if((d==W)&&(st==1)) { st=5; } + + else if((d==E)&&(1<=st<=4)) { st=st+1; } + + else if((d==W)&&(2<=st<=5)) { st=st-1; } + + Settings::CallFunctions(lcd, pad, st); } + pad.tone(1000.0,0.1); return cs_sc; } +void Settings::CallFunctions(N5110 &lcd, Gamepad &pad, int st) +{ + lcd.drawSprite(5,22,13,8,(int *)naviL); //Function used to draw the sprite. + lcd.drawSprite(71,22,13,8,(int *)naviR); //Function used to draw the sprite. + switch (st) { + case 1: + Settings::controlSensitivity(lcd, pad); + break; + case 2: + Settings::brigntness(lcd, pad); + break; + case 3: + Settings::contrast(lcd, pad); + break; + case 4: + Settings::volume(lcd, pad); + break; + case 5: + Settings::showCredits(lcd, pad); + break; + } + lcd.refresh(); +} + void Settings::info(N5110 &lcd, Gamepad &pad) { lcd.clear();