summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--games/atc/extern.h3
-rw-r--r--games/atc/graphics.c25
-rw-r--r--games/atc/log.c8
-rw-r--r--games/atc/main.c5
4 files changed, 19 insertions, 22 deletions
diff --git a/games/atc/extern.h b/games/atc/extern.h
index 3d055a6c672..e783fc808f2 100644
--- a/games/atc/extern.h
+++ b/games/atc/extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: extern.h,v 1.2 1998/09/21 07:36:05 pjanzen Exp $ */
+/* $OpenBSD: extern.h,v 1.3 1999/09/01 00:27:07 pjanzen Exp $ */
/* $NetBSD: extern.h,v 1.4 1995/04/27 21:22:22 mycroft Exp $ */
/*-
@@ -85,7 +85,6 @@ void erase_all __P((void));
int getAChar __P((void));
int getcommand __P((void));
int gettoken __P((void));
-void init_gr __P((void));
void ioaddstr __P((int, const char *));
void ioclrtobot __P((void));
void ioclrtoeol __P((int));
diff --git a/games/atc/graphics.c b/games/atc/graphics.c
index 0e9402ed3ab..8d7d016a1e3 100644
--- a/games/atc/graphics.c
+++ b/games/atc/graphics.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: graphics.c,v 1.3 1999/07/31 20:08:30 pjanzen Exp $ */
+/* $OpenBSD: graphics.c,v 1.4 1999/09/01 00:27:07 pjanzen Exp $ */
/* $NetBSD: graphics.c,v 1.3 1995/03/21 15:04:04 cgd Exp $ */
/*-
@@ -50,7 +50,7 @@
#if 0
static char sccsid[] = "@(#)graphics.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: graphics.c,v 1.3 1999/07/31 20:08:30 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: graphics.c,v 1.4 1999/09/01 00:27:07 pjanzen Exp $";
#endif
#endif /* not lint */
@@ -117,12 +117,20 @@ draw_all()
}
void
-init_gr()
+setup_screen(scp)
+ const C_SCREEN *scp;
{
static char buffer[BUFSIZ];
+ int i, j;
+ char str[3];
+ const char *airstr;
initscr();
- if (LINES < 24 || COLS < 80) {
+ /* size of screen depends on chosen game, but we need at least 80
+ * columns for "Information area" to work. */
+ if (LINES < (INPUT_LINES + scp->height) ||
+ COLS < (PLANE_COLS + 2 * scp->width) ||
+ COLS < 80) {
endwin();
errx(1, "screen too small.");
}
@@ -131,15 +139,6 @@ init_gr()
credit = newwin(INPUT_LINES, PLANE_COLS, LINES - INPUT_LINES,
COLS - PLANE_COLS);
planes = newwin(LINES - INPUT_LINES, PLANE_COLS, 0, COLS - PLANE_COLS);
-}
-
-void
-setup_screen(scp)
- const C_SCREEN *scp;
-{
- register int i, j;
- char str[3];
- const char *airstr;
str[2] = '\0';
diff --git a/games/atc/log.c b/games/atc/log.c
index f06018990c1..4ac3723c37c 100644
--- a/games/atc/log.c
+++ b/games/atc/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.5 1998/09/21 07:36:06 pjanzen Exp $ */
+/* $OpenBSD: log.c,v 1.6 1999/09/01 00:27:08 pjanzen Exp $ */
/* $NetBSD: log.c,v 1.3 1995/03/21 15:04:21 cgd Exp $ */
/*-
@@ -50,7 +50,7 @@
#if 0
static char sccsid[] = "@(#)log.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: log.c,v 1.5 1998/09/21 07:36:06 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: log.c,v 1.6 1999/09/01 00:27:08 pjanzen Exp $";
#endif
#endif not lint
@@ -65,8 +65,8 @@ compar(va, vb)
{
const SCORE *a, *b;
- a = (SCORE *)va;
- b = (SCORE *)vb;
+ a = (const SCORE *)va;
+ b = (const SCORE *)vb;
if (b->planes == a->planes)
return (b->time - a->time);
else
diff --git a/games/atc/main.c b/games/atc/main.c
index e69664d5663..6819df1c19b 100644
--- a/games/atc/main.c
+++ b/games/atc/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.7 1998/09/21 07:36:06 pjanzen Exp $ */
+/* $OpenBSD: main.c,v 1.8 1999/09/01 00:27:08 pjanzen Exp $ */
/* $NetBSD: main.c,v 1.4 1995/04/27 21:22:25 mycroft Exp $ */
/*-
@@ -56,7 +56,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: main.c,v 1.7 1998/09/21 07:36:06 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.8 1999/09/01 00:27:08 pjanzen Exp $";
#endif
#endif /* not lint */
@@ -161,7 +161,6 @@ main(ac, av)
if (file == NULL || read_file(file) < 0)
exit(1);
- init_gr();
setup_screen(sp);
addplane();