-/* $NetBSD: pl_7.c,v 1.16 2001/01/01 21:57:38 jwise Exp $ */
+/* $NetBSD: pl_7.c,v 1.28 2007/12/15 19:44:43 perry Exp $ */
/*
* Copyright (c) 1983, 1993
* 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.
*
#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.28 2007/12/15 19:44:43 perry Exp $");
#endif
#endif /* not lint */
-#include <sys/ttydefaults.h>
-#include "player.h"
-#ifdef __STDC__
+#include <curses.h>
+#include <signal.h>
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
+#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include <string.h>
+#include "extern.h"
+#include "player.h"
+#include "display.h"
+static void Scroll(void);
+static void endprompt(int);
+static void adjustview(void);
/*
* Display interface
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;
leaveok(stat_w, 1);
leaveok(turn_w, 1);
noecho();
- crmode();
+ cbreak();
}
void
/*ARGSUSED*/
void
-newturn(int n __attribute__((__unused__)))
+newturn(int n __unused)
{
repaired = loaded = fired = changed = 0;
movebuf[0] = '\0';
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);
{
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);
Scroll();
}
-void
+static void
Scroll(void)
{
if (++sc_line >= SCROLL_Y)
}
void
-prompt(p, ship)
- const char *p;
- struct ship *ship;
+prompt(const char *p, struct ship *ship)
{
static char buf[BUFSIZ];
waddstr(scroll_w, buf);
}
-void
+static void
endprompt(int flag)
{
sc_hasprompt = 0;
viewcol += VIEW_X / 5;
}
-void
+static void
adjustview(void)
{
if (dont_adjust)