Fix two minor presentation bugs.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 7 Feb 2005 20:29:53 +0000 (20:29 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 7 Feb 2005 20:29:53 +0000 (20:29 +0000)
io.c
reports.c

diff --git a/io.c b/io.c
index b3d2438d0b3ed289edd7a92c39790b696c5100da..8ea9d16b5a75e386ac1c4a5c9068c6d5ed510fd9 100644 (file)
--- 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');
index 842ca87e41a648e77de4cfe74efcc48843f53bb8..e26e9324fca7373dda568a1104abc144d8375d72 100644 (file)
--- 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(" ");