date and time created 88/10/19 15:51:23 by bostic
[unix-history] / usr / src / games / sail / player.h
CommitLineData
69b10fe7 1/*
1e008c14 2 * Copyright (c) 1983 Regents of the University of California.
c0ca48ec 3 * All rights reserved.
1e008c14 4 *
c0ca48ec 5 * Redistribution and use in source and binary forms are permitted
65c7d3b6
KB
6 * provided that the above copyright notice and this paragraph are
7 * duplicated in all such forms and that any documentation,
8 * advertising materials, and other materials related to such
9 * distribution and use acknowledge that the software was developed
10 * by the University of California, Berkeley. The name of the
11 * University may not be used to endorse or promote products derived
12 * from this software without specific prior written permission.
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
c0ca48ec 16 *
65c7d3b6 17 * @(#)player.h 5.3 (Berkeley) %G%
b5f0675e
EW
18 */
19
69b10fe7
CL
20#include <curses.h>
21#include "externs.h"
22
b3a57661 23/* sizes and coordinates for the screen */
69b10fe7 24
b3a57661
EW
25#define LINE_T 0
26#define LINE_L 0
27#define LINE_X COLS
28#define LINE_Y 1
29#define LINE_B (LINE_T+LINE_Y-1)
30#define LINE_R (LINE_L+LINE_X-1)
69b10fe7 31
b3a57661
EW
32#define BOX_T 1
33#define BOX_L 0
34#define BOX_X 65
35#define BOX_Y 16
36#define BOX_B (BOX_T+BOX_Y-1)
37#define BOX_R (BOX_L+BOX_X-1)
38
39#define TURN_T BOX_B
b3a57661 40#define TURN_Y 1
67485396
EW
41#define TURN_L ((BOX_L+BOX_R-TURN_X)/2)
42#define TURN_X 9
b3a57661
EW
43#define TURN_B (TURN_T+TURN_Y+1)
44#define TURN_R (TURN_L+TURN_X+1)
45
46#define STAT_T 0
b3a57661 47#define STAT_B BOX_B
67485396
EW
48#define STAT_L (BOX_R+2)
49#define STAT_X 14
b3a57661 50#define STAT_Y (STAT_B-STAT_T+1)
67485396 51#define STAT_R (STAT_L+STAT_X-1)
b3a57661
EW
52#define STAT_1 0
53#define STAT_2 (STAT_1+4)
54#define STAT_3 (STAT_2+7)
55
56#define SCROLL_T (BOX_B+1)
57#define SCROLL_L 0
58#define SCROLL_B (LINES-1)
59#define SCROLL_R (COLS-1)
67485396
EW
60#define SCROLL_X (SCROLL_R-SCROLL_L+1)
61#define SCROLL_Y (SCROLL_B-SCROLL_T+1)
b3a57661
EW
62
63#define VIEW_T (BOX_T+1)
64#define VIEW_L (BOX_L+1)
65#define VIEW_X (BOX_X-5)
66#define VIEW_Y (BOX_Y-2)
67#define VIEW_B (VIEW_T+VIEW_Y-1)
68#define VIEW_R (VIEW_L+VIEW_X-1)
69
70#define SLOT_T VIEW_T
71#define SLOT_L (VIEW_R+1)
72#define SLOT_X 3
73#define SLOT_Y VIEW_Y
74#define SLOT_B VIEW_B
75#define SLOT_R (SLOT_L+SLOT_X-1)
76
67485396
EW
77#ifdef SIGTSTP
78#define SCREENTEST() (initscr() != ERR && signal(SIGTSTP, SIG_DFL) != BADSIG && STAT_R < COLS && SCROLL_Y > 0)
79#else
80#define SCREENTEST() (initscr() != ERR && STAT_R < COLS && SCROLL_Y > 0)
81#endif
82
b3a57661
EW
83WINDOW *view_w;
84WINDOW *slot_w;
85WINDOW *scroll_w;
86WINDOW *stat_w;
87WINDOW *turn_w;
88
89char done_curses;
90char loaded, fired, changed, repaired;
91char dont_adjust;
92int viewrow, viewcol;
6ca45914 93char movebuf[sizeof SHIP(0)->file->movebuf];
b3a57661
EW
94char version[];
95int player;
96struct ship *ms; /* memorial structure, &cc->ship[player] */
97struct File *mf; /* ms->file */
98struct shipspecs *mc; /* ms->specs */
99
100/* condition codes for leave() */
101#define LEAVE_QUIT 0
102#define LEAVE_CAPTURED 1
103#define LEAVE_HURRICAN 2
104#define LEAVE_DRIVER 3
2b5c5996 105#define LEAVE_FORK 4
67485396 106#define LEAVE_SYNC 5