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