|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1983 Regents of the University of California. ! 3: * All rights reserved. ! 4: * ! 5: * Redistribution and use in source and binary forms are permitted ! 6: * provided that: (1) source distributions retain this entire copyright ! 7: * notice and comment, and (2) distributions including binaries display ! 8: * the following acknowledgement: ``This product includes software ! 9: * developed by the University of California, Berkeley and its contributors'' ! 10: * in the documentation or other materials provided with the distribution ! 11: * and in all advertising materials mentioning features or use of this ! 12: * software. Neither the name of the University nor the names of its ! 13: * contributors may be used to endorse or promote products derived ! 14: * from this software without specific prior written permission. ! 15: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 16: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 17: * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 18: * ! 19: * @(#)player.h 5.4 (Berkeley) 6/1/90 ! 20: */ ! 21: ! 22: #include <curses.h> ! 23: #include "externs.h" ! 24: ! 25: /* sizes and coordinates for the screen */ ! 26: ! 27: #define LINE_T 0 ! 28: #define LINE_L 0 ! 29: #define LINE_X COLS ! 30: #define LINE_Y 1 ! 31: #define LINE_B (LINE_T+LINE_Y-1) ! 32: #define LINE_R (LINE_L+LINE_X-1) ! 33: ! 34: #define BOX_T 1 ! 35: #define BOX_L 0 ! 36: #define BOX_X 65 ! 37: #define BOX_Y 16 ! 38: #define BOX_B (BOX_T+BOX_Y-1) ! 39: #define BOX_R (BOX_L+BOX_X-1) ! 40: ! 41: #define TURN_T BOX_B ! 42: #define TURN_Y 1 ! 43: #define TURN_L ((BOX_L+BOX_R-TURN_X)/2) ! 44: #define TURN_X 9 ! 45: #define TURN_B (TURN_T+TURN_Y+1) ! 46: #define TURN_R (TURN_L+TURN_X+1) ! 47: ! 48: #define STAT_T 0 ! 49: #define STAT_B BOX_B ! 50: #define STAT_L (BOX_R+2) ! 51: #define STAT_X 14 ! 52: #define STAT_Y (STAT_B-STAT_T+1) ! 53: #define STAT_R (STAT_L+STAT_X-1) ! 54: #define STAT_1 0 ! 55: #define STAT_2 (STAT_1+4) ! 56: #define STAT_3 (STAT_2+7) ! 57: ! 58: #define SCROLL_T (BOX_B+1) ! 59: #define SCROLL_L 0 ! 60: #define SCROLL_B (LINES-1) ! 61: #define SCROLL_R (COLS-1) ! 62: #define SCROLL_X (SCROLL_R-SCROLL_L+1) ! 63: #define SCROLL_Y (SCROLL_B-SCROLL_T+1) ! 64: ! 65: #define VIEW_T (BOX_T+1) ! 66: #define VIEW_L (BOX_L+1) ! 67: #define VIEW_X (BOX_X-5) ! 68: #define VIEW_Y (BOX_Y-2) ! 69: #define VIEW_B (VIEW_T+VIEW_Y-1) ! 70: #define VIEW_R (VIEW_L+VIEW_X-1) ! 71: ! 72: #define SLOT_T VIEW_T ! 73: #define SLOT_L (VIEW_R+1) ! 74: #define SLOT_X 3 ! 75: #define SLOT_Y VIEW_Y ! 76: #define SLOT_B VIEW_B ! 77: #define SLOT_R (SLOT_L+SLOT_X-1) ! 78: ! 79: #ifdef SIGTSTP ! 80: #define SCREENTEST() (initscr() != ERR && signal(SIGTSTP, SIG_DFL) != BADSIG && STAT_R < COLS && SCROLL_Y > 0) ! 81: #else ! 82: #define SCREENTEST() (initscr() != ERR && STAT_R < COLS && SCROLL_Y > 0) ! 83: #endif ! 84: ! 85: WINDOW *view_w; ! 86: WINDOW *slot_w; ! 87: WINDOW *scroll_w; ! 88: WINDOW *stat_w; ! 89: WINDOW *turn_w; ! 90: ! 91: char done_curses; ! 92: char loaded, fired, changed, repaired; ! 93: char dont_adjust; ! 94: int viewrow, viewcol; ! 95: char movebuf[sizeof SHIP(0)->file->movebuf]; ! 96: char version[]; ! 97: int player; ! 98: struct ship *ms; /* memorial structure, &cc->ship[player] */ ! 99: struct File *mf; /* ms->file */ ! 100: struct shipspecs *mc; /* ms->specs */ ! 101: ! 102: /* condition codes for leave() */ ! 103: #define LEAVE_QUIT 0 ! 104: #define LEAVE_CAPTURED 1 ! 105: #define LEAVE_HURRICAN 2 ! 106: #define LEAVE_DRIVER 3 ! 107: #define LEAVE_FORK 4 ! 108: #define LEAVE_SYNC 5
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.