diff options
author | Paul Janzen <pjanzen@cvs.openbsd.org> | 1998-09-15 05:12:34 +0000 |
---|---|---|
committer | Paul Janzen <pjanzen@cvs.openbsd.org> | 1998-09-15 05:12:34 +0000 |
commit | 382e5fc06b0d163465f52340367ebd0ad2290953 (patch) | |
tree | 70f97b75511270d6bcf539458bed34e47f29d492 /games/larn/savelev.c | |
parent | a191b615b33316ed26f562fc953609f4076439a4 (diff) |
NetBSD merge; also renamed some functions so as not to conflict with curses
Diffstat (limited to 'games/larn/savelev.c')
-rw-r--r-- | games/larn/savelev.c | 74 |
1 files changed, 44 insertions, 30 deletions
diff --git a/games/larn/savelev.c b/games/larn/savelev.c index 4761233c52f..a2aa5c44a6f 100644 --- a/games/larn/savelev.c +++ b/games/larn/savelev.c @@ -1,51 +1,65 @@ -#ifndef lint -static char rcsid[] = "$NetBSD: savelev.c,v 1.3 1995/03/23 08:34:13 cgd Exp $"; -#endif /* not lint */ +/* $OpenBSD: savelev.c,v 1.2 1998/09/15 05:12:33 pjanzen Exp $ */ +/* $NetBSD: savelev.c,v 1.4 1997/10/18 20:03:45 christos Exp $ */ /* savelev.c Larn is copyrighted 1986 by Noah Morgan. */ +#ifndef lint +static char rcsid[] = "$OpenBSD: savelev.c,v 1.2 1998/09/15 05:12:33 pjanzen Exp $"; +#endif /* not lint */ #include "header.h" -extern struct cel *cell; +#include "extern.h" /* * routine to save the present level into storage */ +void savelevel() - { - register struct cel *pcel; - register char *pitem,*pknow,*pmitem; - register short *phitp,*piarg; - register struct cel *pecel; - pcel = &cell[level*MAXX*MAXY]; /* pointer to this level's cells */ - pecel = pcel + MAXX*MAXY; /* pointer to past end of this level's cells */ - pitem=item[0]; piarg=iarg[0]; pknow=know[0]; pmitem=mitem[0]; phitp=hitp[0]; - while (pcel < pecel) - { - pcel->mitem = *pmitem++; - pcel->hitp = *phitp++; - pcel->item = *pitem++; - pcel->know = *pknow++; +{ + struct cel *pcel; + char *pitem, *pknow, *pmitem; + short *phitp, *piarg; + struct cel *pecel; + pcel = &cell[level * MAXX * MAXY]; /* pointer to this level's + * cells */ + pecel = pcel + MAXX * MAXY; /* pointer to past end of this + * level's cells */ + pitem = item[0]; + piarg = iarg[0]; + pknow = know[0]; + pmitem = mitem[0]; + phitp = hitp[0]; + while (pcel < pecel) { + pcel->mitem = *pmitem++; + pcel->hitp = *phitp++; + pcel->item = *pitem++; + pcel->know = *pknow++; pcel++->iarg = *piarg++; - } } +} /* * routine to restore a level from storage */ +void getlevel() - { - register struct cel *pcel; - register char *pitem,*pknow,*pmitem; - register short *phitp,*piarg; - register struct cel *pecel; - pcel = &cell[level*MAXX*MAXY]; /* pointer to this level's cells */ - pecel = pcel + MAXX*MAXY; /* pointer to past end of this level's cells */ - pitem=item[0]; piarg=iarg[0]; pknow=know[0]; pmitem=mitem[0]; phitp=hitp[0]; - while (pcel < pecel) - { +{ + struct cel *pcel; + char *pitem, *pknow, *pmitem; + short *phitp, *piarg; + struct cel *pecel; + pcel = &cell[level * MAXX * MAXY]; /* pointer to this level's + * cells */ + pecel = pcel + MAXX * MAXY; /* pointer to past end of this + * level's cells */ + pitem = item[0]; + piarg = iarg[0]; + pknow = know[0]; + pmitem = mitem[0]; + phitp = hitp[0]; + while (pcel < pecel) { *pmitem++ = pcel->mitem; *phitp++ = pcel->hitp; *pitem++ = pcel->item; *pknow++ = pcel->know; *piarg++ = pcel++->iarg; - } } +} |