![](/media/cache/profiles/LinkedIn_0NghoZJ.jpeg.50x50_q85.jpg)
Snake vs Block Game to be run upon K64F.
Diff: MenuClasses/Settings/Settings.cpp
- Revision:
- 57:845781aea5ec
- Parent:
- 56:142e9fdb77a8
- Child:
- 61:f3c402bc2ad0
--- a/MenuClasses/Settings/Settings.cpp Sun Apr 28 16:56:08 2019 +0000 +++ b/MenuClasses/Settings/Settings.cpp Sun Apr 28 18:17:48 2019 +0000 @@ -42,6 +42,40 @@ {1,1,0,0,0,0,0,0}, }; +int screenContrast[13][13] = { + {0,0,0,0,1,1,1,1,1,0,0,0,0}, + {0,0,0,1,0,0,0,0,0,1,0,0,0}, + {0,0,1,0,0,1,1,1,0,0,1,0,0}, + {0,1,0,1,1,0,0,1,1,1,0,1,0}, + {1,0,0,1,0,0,0,1,1,1,0,0,1}, + {1,0,1,1,0,0,0,1,1,1,1,0,1}, + {1,0,1,0,0,0,0,1,1,1,1,0,1}, + {1,0,1,0,0,0,0,1,1,1,1,0,1}, + {1,0,0,1,0,0,0,1,1,1,0,0,1}, + {0,1,0,1,1,0,0,1,1,1,0,1,0}, + {0,0,1,0,0,1,1,1,0,0,1,0,0}, + {0,0,0,1,0,0,0,0,0,1,0,0,0}, + {0,0,0,0,1,1,1,1,1,0,0,0,0}, +}; + +int brightness[15][15] = { + {0,0,0,1,0,0,0,1,0,0,0,1,0,0,0}, + {0,1,0,0,1,0,0,1,0,0,1,0,0,1,0}, + {0,0,1,0,0,1,0,1,0,1,0,0,1,0,0}, + {1,0,0,1,0,0,1,1,1,0,0,1,0,0,1}, + {0,1,0,0,1,1,0,0,0,1,1,0,0,1,0}, + {0,0,1,0,1,0,0,0,0,0,1,0,1,0,0}, + {0,0,0,1,0,0,0,0,0,0,0,1,0,0,0}, + {1,1,1,1,0,0,0,0,0,0,0,1,1,1,1}, + {0,0,0,1,0,0,0,0,0,0,0,1,0,0,0}, + {0,0,1,0,1,0,0,0,0,0,1,0,1,0,0}, + {0,1,0,0,1,1,0,0,0,1,1,0,0,1,0}, + {1,0,0,1,0,0,1,1,1,0,0,1,0,0,1}, + {0,0,1,0,0,1,0,1,0,1,0,0,1,0,0}, + {0,1,0,0,1,0,0,1,0,0,1,0,0,1,0}, + {0,0,0,1,0,0,0,1,0,0,0,1,0,0,0}, +}; + float * Settings::Implement(N5110 &lcd, Gamepad &pad, float cs) { Settings::info(lcd, pad); @@ -52,13 +86,13 @@ wait(1/cs); lcd.clear(); - if((d==E)&&(st==5)) { st=1; } + if((d==E)&&(st==4)) { st=1; } - else if((d==W)&&(st==1)) { st=5; } + else if((d==W)&&(st==1)) { st=4; } - else if((d==E)&&(1<=st<=4)) { st=st+1; } + else if((d==E)&&(1<=st<=3)) { st=st+1; } - else if((d==W)&&(2<=st<=5)) { st=st-1; } + else if((d==W)&&(2<=st<=4)) { st=st-1; } Settings::CallFunctions(lcd, pad, st); } @@ -81,9 +115,6 @@ Settings::contrast(lcd, pad); break; case 4: - Settings::volume(lcd, pad); - break; - case 5: Settings::showCredits(lcd, pad); break; } @@ -125,7 +156,7 @@ void Settings::brigntness(N5110 &lcd, Gamepad &pad) { - lcd.printString("Brigntness",9,0); + lcd.drawSprite(35,2,15,15,(int *)brightness); //Function used to draw the sprite. float pot; pot = pad.read_pot(); lcd.drawRect(15,22,54,13,FILL_TRANSPARENT); @@ -136,7 +167,7 @@ void Settings::contrast(N5110 &lcd, Gamepad &pad) { - lcd.printString("Contrast",16,0); + lcd.drawSprite(36,3,13,13,(int *)screenContrast); //Function used to draw the sprite. float pot; pot = ((pad.read_pot()+3.8)/8); lcd.drawRect(15,22,54,13,FILL_TRANSPARENT); @@ -145,16 +176,6 @@ pad.leds_on(); } -void Settings::volume(N5110 &lcd, Gamepad &pad) -{ - lcd.printString("Volume",20,0); - float pot; - pot = pad.read_pot(); - lcd.drawRect(15,22,54,13,FILL_TRANSPARENT); - lcd.drawRect(15,22,pot*54,13,FILL_BLACK); - pad.leds_on(); -} - void Settings::showCredits(N5110 &lcd, Gamepad &pad) { lcd.printString("Show Credits?",5,0);