Fix input on linux

This commit is contained in:
j3d1 2018-11-06 09:04:43 +01:00
parent f3037a06ce
commit 8c38903445
4 changed files with 33 additions and 36 deletions

View file

@ -3,7 +3,7 @@
#include "node.h"
#include "gfx/canvas.h"
char peng[] = {'_','_','_','_','_',0};
char peng[] = {' ', ' ', ' ', ' ', ' ', 0};
int j = 0;
@ -11,19 +11,16 @@ void fooValue::render(canvas& c){
for(int i = 0; i<32; i++)
c.draw(0,i);
for(int i = 0; i<c.getWidth(); i++)
c.draw(i,31-i%32);
for(int i = 0; i<c.getWidth(); i++)
c.draw(i,31-(i+16)%32);
c.print(5 , 10, title_);
peng[0]=input[0]?' ':'#';
peng[1]=input[1]?' ':'#';
peng[2]=input[2]?' ':'#';
peng[3]=input[3]?' ':'#';
peng[0] = input[0] ? 'L' : ' ';
peng[1] = input[1] ? 'R' : ' ';
peng[2] = input[2] ? 'U' : ' ';
peng[3] = input[3] ? 'D' : ' ';
j++;
j%=26;
peng[4] = 'a'+j;
j %= 10;
peng[4] = 'A' + j;
c.print(5 , 20, peng);
}
@ -38,6 +35,6 @@ void menu::render(canvas& c){
for(int i = 0; i<32;i++)
c.draw(0,i);
for(int i = 0; i<32 && i<c.getWidth();i++)
c.draw((i%c.getWidth()),i);
c.print(5, 10, title_);
}