X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/a6e8d8ed2cbb18fa9d9277395a46a38295b2d6bf..f12b51f99bbe8bb6ad7eca12b047ba9b46836ee6:/sail/pl_7.c diff --git a/sail/pl_7.c b/sail/pl_7.c index b876edca..4a3bd62d 100644 --- a/sail/pl_7.c +++ b/sail/pl_7.c @@ -1,4 +1,4 @@ -/* $NetBSD: pl_7.c,v 1.16 2001/01/01 21:57:38 jwise Exp $ */ +/* $NetBSD: pl_7.c,v 1.27 2003/08/07 09:37:44 agc Exp $ */ /* * Copyright (c) 1983, 1993 @@ -12,11 +12,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -38,20 +34,24 @@ #if 0 static char sccsid[] = "@(#)pl_7.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: pl_7.c,v 1.16 2001/01/01 21:57:38 jwise Exp $"); +__RCSID("$NetBSD: pl_7.c,v 1.27 2003/08/07 09:37:44 agc Exp $"); #endif #endif /* not lint */ -#include -#include "player.h" -#ifdef __STDC__ +#include +#include #include -#else -#include -#endif +#include #include #include +#include +#include "extern.h" +#include "player.h" +#include "display.h" +static void Scroll(void); +static void endprompt(int); +static void adjustview(void); /* * Display interface @@ -68,9 +68,9 @@ WINDOW *scroll_w; WINDOW *stat_w; WINDOW *turn_w; -char done_curses; -char loaded, fired, changed, repaired; -char dont_adjust; +int done_curses; +int loaded, fired, changed, repaired; +int dont_adjust; int viewrow, viewcol; char movebuf[sizeof SHIP(0)->file->movebuf]; int player; @@ -97,7 +97,7 @@ initscreen(void) leaveok(stat_w, 1); leaveok(turn_w, 1); noecho(); - crmode(); + cbreak(); } void @@ -174,9 +174,9 @@ Signal(const char *fmt, struct ship *ship, ...) va_list ap; char format[BUFSIZ]; - va_start(ap, ship); if (!done_curses) return; + va_start(ap, ship); if (*fmt == '\7') putchar(*fmt++); fmtship(format, sizeof(format), fmt, ship); @@ -191,9 +191,9 @@ Msg(const char *fmt, ...) { va_list ap; - va_start(ap, fmt); if (!done_curses) return; + va_start(ap, fmt); if (*fmt == '\7') putchar(*fmt++); vwprintw(scroll_w, fmt, ap); @@ -201,7 +201,7 @@ Msg(const char *fmt, ...) Scroll(); } -void +static void Scroll(void) { if (++sc_line >= SCROLL_Y) @@ -211,9 +211,7 @@ Scroll(void) } void -prompt(p, ship) - const char *p; - struct ship *ship; +prompt(const char *p, struct ship *ship) { static char buf[BUFSIZ]; @@ -224,7 +222,7 @@ prompt(p, ship) waddstr(scroll_w, buf); } -void +static void endprompt(int flag) { sc_hasprompt = 0; @@ -510,7 +508,7 @@ rightview(void) viewcol += VIEW_X / 5; } -void +static void adjustview(void) { if (dont_adjust)