summaryrefslogtreecommitdiffstats
path: root/hunt/huntd/draw.c
diff options
context:
space:
mode:
authorlukem <lukem@NetBSD.org>1997-10-10 16:32:15 +0000
committerlukem <lukem@NetBSD.org>1997-10-10 16:32:15 +0000
commit50f99331097302f77db413ba7ad7299d928163eb (patch)
tree376410fecfef0c2ac47f5b4f0643e6a84a373cdc /hunt/huntd/draw.c
parenta25e10613cc56cac1b954b119f757a272dee9bc8 (diff)
downloadbsdgames-darwin-50f99331097302f77db413ba7ad7299d928163eb.tar.gz
bsdgames-darwin-50f99331097302f77db413ba7ad7299d928163eb.zip
Yet Another Monster Commit:
- WARNSify - getopt returns -1 not EOF - select() uses an fd_set, not int/long; modify code to use FD_* et al instead of direct bitwise operations - in otto.c::look (renamed to ottolook() to prevent name clash), the case WEST section had a 'goto cont_east', instead of 'goto cont_west'. (picked up by WARNS=1, because cont_west was an unused label because of this typo). probably meant that otto got lost in the maze :-/ - deprecate register, convert bcmp() -> memcmp()
Diffstat (limited to 'hunt/huntd/draw.c')
-rw-r--r--hunt/huntd/draw.c94
1 files changed, 55 insertions, 39 deletions
diff --git a/hunt/huntd/draw.c b/hunt/huntd/draw.c
index bbadbe16..ee53641c 100644
--- a/hunt/huntd/draw.c
+++ b/hunt/huntd/draw.c
@@ -1,18 +1,25 @@
+/* $NetBSD: draw.c,v 1.2 1997/10/10 16:33:04 lukem Exp $ */
/*
* Hunt
* Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold
* San Francisco, California
*/
+#include <sys/cdefs.h>
+#ifndef lint
+__RCSID("$NetBSD: draw.c,v 1.2 1997/10/10 16:33:04 lukem Exp $");
+#endif /* not lint */
+
# include "hunt.h"
+void
drawmaze(pp)
-register PLAYER *pp;
+ PLAYER *pp;
{
- register int x;
- register char *sp;
- register int y;
- register char *endp;
+ int x;
+ char *sp;
+ int y;
+ char *endp;
clrscr(pp);
outstr(pp, pp->p_maze[0], WIDTH);
@@ -38,11 +45,12 @@ register PLAYER *pp;
* drawstatus - put up the status lines (this assumes the screen
* size is 80x24 with the maze being 64x24)
*/
+void
drawstatus(pp)
-register PLAYER *pp;
+ PLAYER *pp;
{
- register int i;
- register PLAYER *np;
+ int i;
+ PLAYER *np;
cgoto(pp, STAT_AMMO_ROW, STAT_LABEL_COL);
outstr(pp, "Ammo:", 5);
@@ -89,10 +97,11 @@ register PLAYER *pp;
# endif
}
+void
look(pp)
-register PLAYER *pp;
+ PLAYER *pp;
{
- register int x, y;
+ int x, y;
x = pp->p_x;
y = pp->p_y;
@@ -136,12 +145,13 @@ register PLAYER *pp;
cgoto(pp, y, x);
}
+void
see(pp, face)
-register PLAYER *pp;
-int face;
+ PLAYER *pp;
+ int face;
{
- register char *sp;
- register int y, x, i, cnt;
+ char *sp;
+ int y, x, i, cnt;
x = pp->p_x;
y = pp->p_y;
@@ -149,7 +159,7 @@ int face;
switch (face) {
case LEFTS:
sp = &Maze[y][x];
- for (i = 0; See_over[*--sp]; i++)
+ for (i = 0; See_over[(int)*--sp]; i++)
continue;
if (i == 0)
@@ -173,7 +183,7 @@ int face;
break;
case RIGHT:
sp = &Maze[y][++x];
- for (i = 0; See_over[*sp++]; i++)
+ for (i = 0; See_over[(int)*sp++]; i++)
continue;
if (i == 0)
@@ -197,7 +207,7 @@ int face;
break;
case ABOVE:
sp = &Maze[--y][x];
- if (!See_over[*sp])
+ if (!See_over[(int)*sp])
break;
do {
--y;
@@ -205,11 +215,11 @@ int face;
check(pp, y, x - 1);
check(pp, y, x );
check(pp, y, x + 1);
- } while (See_over[*sp]);
+ } while (See_over[(int)*sp]);
break;
case BELOW:
sp = &Maze[++y][x];
- if (!See_over[*sp])
+ if (!See_over[(int)*sp])
break;
do {
y++;
@@ -217,18 +227,19 @@ int face;
check(pp, y, x - 1);
check(pp, y, x );
check(pp, y, x + 1);
- } while (See_over[*sp]);
+ } while (See_over[(int)*sp]);
break;
}
}
+void
check(pp, y, x)
-PLAYER *pp;
-int y, x;
+ PLAYER *pp;
+ int y, x;
{
- register int index;
- register int ch;
- register PLAYER *rpp;
+ int index;
+ int ch;
+ PLAYER *rpp;
index = y * sizeof Maze[0] + x;
ch = ((char *) Maze)[index];
@@ -249,12 +260,13 @@ int y, x;
* showstat
* Update the status of players
*/
+void
showstat(pp)
-register PLAYER *pp;
+ PLAYER *pp;
{
- register PLAYER *np;
- register int y;
- register char c;
+ PLAYER *np;
+ int y;
+ char c;
y = STAT_PLAY_ROW + 1 + (pp - Player);
c = stat_char(pp);
@@ -275,12 +287,13 @@ register PLAYER *pp;
* Draw the player on the screen and show him to everyone who's scanning
* unless he is cloaked.
*/
+void
drawplayer(pp, draw)
-PLAYER *pp;
-FLAG draw;
+ PLAYER *pp;
+ FLAG draw;
{
- register PLAYER *newp;
- register int x, y;
+ PLAYER *newp;
+ int x, y;
x = pp->p_x;
y = pp->p_y;
@@ -312,9 +325,10 @@ FLAG draw;
showstat(pp);
}
+void
message(pp, s)
-register PLAYER *pp;
-char *s;
+ PLAYER *pp;
+ char *s;
{
cgoto(pp, HEIGHT, 0);
outstr(pp, s, strlen(s));
@@ -326,8 +340,9 @@ char *s;
* Turn a character into the right direction character if we are
* looking at the current player.
*/
+char
translate(ch)
-char ch;
+ char ch;
{
switch (ch) {
case LEFTS:
@@ -346,11 +361,12 @@ char ch;
* player_sym:
* Return the player symbol
*/
+int
player_sym(pp, y, x)
-PLAYER *pp;
-int y, x;
+ PLAYER *pp;
+ int y, x;
{
- register PLAYER *npp;
+ PLAYER *npp;
npp = play_at(y, x);
if (npp->p_ident->i_team == ' ')