From: Eric S. Raymond Date: Mon, 7 Feb 2005 20:29:53 +0000 (+0000) Subject: Fix two minor presentation bugs. X-Git-Tag: 2.0~331 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=6863b89428c92473a3eead55771f59d8a6da2cb3;p=super-star-trek.git Fix two minor presentation bugs. --- diff --git a/io.c b/io.c index b3d2438..8ea9d16 100644 --- a/io.c +++ b/io.c @@ -9,7 +9,7 @@ #include "sst.h" #include "sstlinux.h" -static int linecount; /* for paging */ +static int rows, linecount; /* for paging */ WINDOW *curwnd; @@ -29,8 +29,9 @@ static void outro(void) void iostart(void) { - if (game.options & OPTION_CURSES) { - + if (!(game.options & OPTION_CURSES)) { + rows = atoi(getenv("LINES")); + } else { if (atexit(outro)){ fprintf(stderr,"Unable to register outro(), exiting...\n"); exit(1); @@ -44,15 +45,15 @@ void iostart(void) (void)cbreak(); #ifdef A_COLOR { - start_color(); - init_pair(COLOR_BLACK, COLOR_BLACK, COLOR_BLACK); - init_pair(COLOR_GREEN, COLOR_GREEN, COLOR_BLACK); - init_pair(COLOR_RED, COLOR_RED, COLOR_BLACK); - init_pair(COLOR_CYAN, COLOR_CYAN, COLOR_BLACK); - init_pair(COLOR_WHITE, COLOR_WHITE, COLOR_BLACK); - init_pair(COLOR_MAGENTA, COLOR_MAGENTA, COLOR_BLACK); - init_pair(COLOR_BLUE, COLOR_BLUE, COLOR_BLACK); - init_pair(COLOR_YELLOW, COLOR_YELLOW, COLOR_BLACK); + start_color(); + init_pair(COLOR_BLACK, COLOR_BLACK, COLOR_BLACK); + init_pair(COLOR_GREEN, COLOR_GREEN, COLOR_BLACK); + init_pair(COLOR_RED, COLOR_RED, COLOR_BLACK); + init_pair(COLOR_CYAN, COLOR_CYAN, COLOR_BLACK); + init_pair(COLOR_WHITE, COLOR_WHITE, COLOR_BLACK); + init_pair(COLOR_MAGENTA, COLOR_MAGENTA, COLOR_BLACK); + init_pair(COLOR_BLUE, COLOR_BLUE, COLOR_BLACK); + init_pair(COLOR_YELLOW, COLOR_YELLOW, COLOR_BLACK); } #endif /* A_COLOR */ //(void)noecho(); @@ -108,7 +109,7 @@ void pause_game(int i) fgets(buf, sizeof(buf), stdin); if (i != 0) { int j; - for (j = 0; j < 24; j++) + for (j = 0; j < rows; j++) putchar('\n'); } linecount = 0; @@ -123,7 +124,7 @@ void skip(int i) proutn("\n\r"); } else { linecount++; - if (linecount >= 24) + if (linecount >= rows) pause_game(0); else putchar('\n'); diff --git a/reports.c b/reports.c index 842ca87..e26e932 100644 --- a/reports.c +++ b/reports.c @@ -143,7 +143,7 @@ void lrscan(void) if (game.state.galaxy[x][y].supernova) proutn("***"); else - proutn(" %-3d", game.state.chart[x][y].klingons*100 + game.state.chart[x][y].starbase * 10 + game.state.chart[x][y].stars); + proutn(" %3d", game.state.chart[x][y].klingons*100 + game.state.chart[x][y].starbase * 10 + game.state.chart[x][y].stars); } } prout(" ");