spell
[unix-history] / usr / src / games / sail / player.h
CommitLineData
69b10fe7 1/*
02cf2247
KB
2 * Copyright (c) 1983, 1993
3 * The Regents of the University of California. All rights reserved.
1e008c14 4 *
b2e7427f 5 * %sccs.include.redist.c%
c0ca48ec 6 *
02cf2247 7 * @(#)player.h 8.1 (Berkeley) %G%
b5f0675e
EW
8 */
9
69b10fe7
CL
10#include <curses.h>
11#include "externs.h"
12
b3a57661 13/* sizes and coordinates for the screen */
69b10fe7 14
b3a57661
EW
15#define LINE_T 0
16#define LINE_L 0
17#define LINE_X COLS
18#define LINE_Y 1
19#define LINE_B (LINE_T+LINE_Y-1)
20#define LINE_R (LINE_L+LINE_X-1)
69b10fe7 21
b3a57661
EW
22#define BOX_T 1
23#define BOX_L 0
24#define BOX_X 65
25#define BOX_Y 16
26#define BOX_B (BOX_T+BOX_Y-1)
27#define BOX_R (BOX_L+BOX_X-1)
28
29#define TURN_T BOX_B
b3a57661 30#define TURN_Y 1
67485396
EW
31#define TURN_L ((BOX_L+BOX_R-TURN_X)/2)
32#define TURN_X 9
b3a57661
EW
33#define TURN_B (TURN_T+TURN_Y+1)
34#define TURN_R (TURN_L+TURN_X+1)
35
36#define STAT_T 0
b3a57661 37#define STAT_B BOX_B
67485396
EW
38#define STAT_L (BOX_R+2)
39#define STAT_X 14
b3a57661 40#define STAT_Y (STAT_B-STAT_T+1)
67485396 41#define STAT_R (STAT_L+STAT_X-1)
b3a57661
EW
42#define STAT_1 0
43#define STAT_2 (STAT_1+4)
44#define STAT_3 (STAT_2+7)
45
46#define SCROLL_T (BOX_B+1)
47#define SCROLL_L 0
48#define SCROLL_B (LINES-1)
49#define SCROLL_R (COLS-1)
67485396
EW
50#define SCROLL_X (SCROLL_R-SCROLL_L+1)
51#define SCROLL_Y (SCROLL_B-SCROLL_T+1)
b3a57661
EW
52
53#define VIEW_T (BOX_T+1)
54#define VIEW_L (BOX_L+1)
55#define VIEW_X (BOX_X-5)
56#define VIEW_Y (BOX_Y-2)
57#define VIEW_B (VIEW_T+VIEW_Y-1)
58#define VIEW_R (VIEW_L+VIEW_X-1)
59
60#define SLOT_T VIEW_T
61#define SLOT_L (VIEW_R+1)
62#define SLOT_X 3
63#define SLOT_Y VIEW_Y
64#define SLOT_B VIEW_B
65#define SLOT_R (SLOT_L+SLOT_X-1)
66
67485396
EW
67#ifdef SIGTSTP
68#define SCREENTEST() (initscr() != ERR && signal(SIGTSTP, SIG_DFL) != BADSIG && STAT_R < COLS && SCROLL_Y > 0)
69#else
70#define SCREENTEST() (initscr() != ERR && STAT_R < COLS && SCROLL_Y > 0)
71#endif
72
b3a57661
EW
73WINDOW *view_w;
74WINDOW *slot_w;
75WINDOW *scroll_w;
76WINDOW *stat_w;
77WINDOW *turn_w;
78
79char done_curses;
80char loaded, fired, changed, repaired;
81char dont_adjust;
82int viewrow, viewcol;
6ca45914 83char movebuf[sizeof SHIP(0)->file->movebuf];
b3a57661
EW
84char version[];
85int player;
86struct ship *ms; /* memorial structure, &cc->ship[player] */
87struct File *mf; /* ms->file */
88struct shipspecs *mc; /* ms->specs */
89
90/* condition codes for leave() */
91#define LEAVE_QUIT 0
92#define LEAVE_CAPTURED 1
93#define LEAVE_HURRICAN 2
94#define LEAVE_DRIVER 3
2b5c5996 95#define LEAVE_FORK 4
67485396 96#define LEAVE_SYNC 5