vt100 simple mode added

This commit is contained in:
Tiehuis
2014-12-06 12:02:12 +13:00
parent 01af91121b
commit 569e11710f
2 changed files with 15 additions and 11 deletions
+13 -10
View File
@@ -70,9 +70,7 @@ int get_keypress(void)
return getch();
}
#elif VT100_COMPATIBLE
#else
#else /* vt100 and standard shared functions */
struct termios sattr;
void drawstate_clear()
{
@@ -90,8 +88,19 @@ void drawstate_init(void)
tcsetattr(STDOUT_FILENO, TCSANOW, &tattr);
}
int get_keypress(void)
{
return fgetc(stdin);
}
void draw_screen(struct gamestate *g)
{
/* Clear the screen each draw if we are able to */
#ifdef VT100_COMPATIBLE
printf("\033[2J\033[H");
#endif
printf("HISCORE: %ld |", g->score_high);
printf("| SCORE: %ld ", g->score);
if (g->score_last) printf("(+%ld)", g->score_last);
@@ -114,13 +123,7 @@ void draw_screen(struct gamestate *g)
ITER(g->opts->grid_width, printf("------"));
printf("-\n\n");
}
int get_keypress(void)
{
return fgetc(stdin);
}
#endif
#endif /* CURSES */
void ddraw(struct gamestate *g)
{