mirror of
https://github.com/vattam/BSDGames.git
synced 2025-12-21 03:14:50 +00:00
copy in from cvs; cvs2svn fucked up big time
git-svn-id: file:///srv/svn/joey/trunk/src/packages/bsdgames@9775 a4a2c43b-8ac3-0310-8836-e0e880c912e2
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: fly.c,v 1.6 1997/10/11 02:07:20 lukem Exp $ */
|
||||
/* $NetBSD: fly.c,v 1.10 2001/12/04 13:00:24 blymn Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)fly.c 8.2 (Berkeley) 4/28/95";
|
||||
#else
|
||||
__RCSID("$NetBSD: fly.c,v 1.6 1997/10/11 02:07:20 lukem Exp $");
|
||||
__RCSID("$NetBSD: fly.c,v 1.10 2001/12/04 13:00:24 blymn Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -46,20 +46,27 @@ __RCSID("$NetBSD: fly.c,v 1.6 1997/10/11 02:07:20 lukem Exp $");
|
||||
#undef UP
|
||||
#include <curses.h>
|
||||
|
||||
#define abs(a) ((a) < 0 ? -(a) : (a))
|
||||
#define MIDR (LINES/2 - 1)
|
||||
#define MIDC (COLS/2 - 1)
|
||||
|
||||
int row, column;
|
||||
int dr = 0, dc = 0;
|
||||
char destroyed;
|
||||
static int row, column;
|
||||
static int dr = 0, dc = 0;
|
||||
static char destroyed;
|
||||
int ourclock = 120; /* time for all the flights in the game */
|
||||
char cross = 0;
|
||||
sig_t oldsig;
|
||||
static char cross = 0;
|
||||
static sig_t oldsig;
|
||||
|
||||
void
|
||||
static void blast __P((void));
|
||||
static void endfly __P((void));
|
||||
static void moveenemy __P((int));
|
||||
static void notarget __P((void));
|
||||
static void screen __P((void));
|
||||
static void succumb __P((int));
|
||||
static void target __P((void));
|
||||
|
||||
static void
|
||||
succumb(dummy)
|
||||
int dummy __attribute__((unused));
|
||||
int dummy __attribute__((__unused__));
|
||||
{
|
||||
if (oldsig == SIG_DFL) {
|
||||
endfly();
|
||||
@@ -80,7 +87,7 @@ visual()
|
||||
return (0);
|
||||
}
|
||||
oldsig = signal(SIGINT, succumb);
|
||||
crmode();
|
||||
cbreak();
|
||||
noecho();
|
||||
screen();
|
||||
row = rnd(LINES - 3) + 1;
|
||||
@@ -178,7 +185,7 @@ visual()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
screen()
|
||||
{
|
||||
int r, c, n;
|
||||
@@ -195,7 +202,7 @@ screen()
|
||||
refresh();
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
target()
|
||||
{
|
||||
int n;
|
||||
@@ -208,7 +215,7 @@ target()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
notarget()
|
||||
{
|
||||
int n;
|
||||
@@ -221,7 +228,7 @@ notarget()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
blast()
|
||||
{
|
||||
int n;
|
||||
@@ -243,9 +250,9 @@ blast()
|
||||
alarm(1);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
moveenemy(dummy)
|
||||
int dummy __attribute__((unused));
|
||||
int dummy __attribute__((__unused__));
|
||||
{
|
||||
double d;
|
||||
int oldr, oldc;
|
||||
@@ -283,7 +290,7 @@ moveenemy(dummy)
|
||||
alarm(1);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
endfly()
|
||||
{
|
||||
alarm(0);
|
||||
|
||||
Reference in New Issue
Block a user