X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=io.c;h=9b968027e78093d8a1ff1aeb839040a21809abbd;hb=665b7ab04d99076511156ac4da537f0fa144d268;hp=5de081916c4716c48a4fb5b0f74492bb3646693a;hpb=8273c136f86228a8b0c6e66554ef96074a429c0a;p=super-star-trek.git diff --git a/io.c b/io.c index 5de0819..9b96802 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'); @@ -168,7 +169,7 @@ void prouts(char *fmt, ...) va_end(ap); skip(1); for (s = buf; *s; s++) { - delay(500); + delay(30); if (game.options & OPTION_CURSES) { waddch(curwnd, *s); wrefresh(curwnd); @@ -300,7 +301,7 @@ void drawmaps(short l) { if (game.options & OPTION_CURSES) { if (l == 1) - sensor(FALSE); + sensor(); if (l != 2) { setwnd(srscan_window); wmove(curwnd, 0, 0); @@ -408,7 +409,7 @@ void makechart(void) void setpassword(void) { - if (!game.options & OPTION_CURSES) { + if (!(game.options & OPTION_CURSES)) { while (TRUE) { scan(); strcpy(game.passwd, citem);