#include <strings.h>
#endif
-#include <curses.h>
#include "empire.h"
#include "extern.h"
-/* $Id: display.c,v 1.7 2000/07/28 05:12:50 esr Exp esr $ - (c) Copyright 1987, 1988 Chuck Simmons */
+/* $Id: display.c,v 1.8 2002/04/19 09:17:01 esr Exp esr $ - (c) Copyright 1987, 1988 Chuck Simmons */
/*
* Copyright (C) 1987, 1988 Chuck Simmons
pos_str (1, cols-12, " User Comp",0,0,0,0,0,0,0,0);
pos_str (2, cols-12, "%5d %5d", user_score, comp_score,0,0,0,0,0,0);
}
+
+/*
+Clear the end of a specified line starting at the specified column.
+*/
+
+void
+clreol(linep, colp)
+int linep, colp;
+{
+ (void) move (linep, colp);
+ (void) clrtoeol();
+}
+
+/*
+Initialize the terminal.
+*/
+
+void
+ttinit()
+{
+ (void) initscr();
+ (void) noecho();
+ (void) crmode();
+#ifdef A_COLOR
+ init_colors();
+#endif /* A_COLOR */
+ lines = LINES;
+ cols = COLS;
+ if (lines > MAP_HEIGHT + NUMTOPS + 1)
+ lines = MAP_HEIGHT + NUMTOPS + 1;
+ if (cols > MAP_WIDTH + NUMSIDES)
+ cols = MAP_WIDTH + NUMSIDES;
+}
+
+
+/*
+Clear the screen. We must also kill information maintained about the
+display.
+*/
+
+void
+clear_screen () {
+ (void) clear ();
+ (void) refresh ();
+ kill_display ();
+}
+
+/*
+Redraw the screen.
+*/
+
+void
+redraw () {
+ (void) clearok (curscr, TRUE);
+ (void) refresh ();
+}
+
+/*
+Wait a little bit to give user a chance to see a message. We refresh
+the screen and pause for a few milliseconds.
+*/
+
+void
+delay () {
+ int t = delay_time;
+ int i = 500;
+ (void) refresh ();
+ if (t > i) {
+ (void) move (LINES - 1, 0);
+ }
+ for (; t > 0; t -= i) {
+ (void) napms ((t > i) ? i : t); /* pause a bit */
+ if (t > i) {
+ addstr ("*");
+ refresh ();
+ }
+ }
+}
+
+/*
+Clean up the display. This routine gets called as we leave the game.
+*/
+
+void
+close_disp()
+{
+ (void) move (LINES - 1, 0);
+ (void) clrtoeol ();
+ (void) refresh ();
+ (void) endwin ();
+}
+
+/*
+Position the cursor and output a string.
+*/
+
+void
+pos_str1 (row, col, str, a, b, c, d, e, f, g, h)
+int row, col;
+char *str, *a;
+int b, c, d, e, f, g, h;
+{
+ (void) move (row, col);
+ addprintf1 (str, a, b, c, d, e, f, g, h);
+}
+void
+pos_str (row, col, str, a, b, c, d, e, f, g, h)
+int row, col;
+char *str;
+int a, b, c, d, e, f, g, h;
+{
+ (void) move (row, col);
+ addprintf (str, a, b, c, d, e, f, g, h);
+}
+
+void
+/* VARARGS1 */
+addprintf (str, a, b, c, d, e, f, g, h)
+char *str;
+int a, b, c, d, e, f, g, h;
+{
+ char junkbuf[STRSIZE];
+
+ (void) sprintf (junkbuf, str, a, b, c, d, e, f, g, h);
+ (void) addstr (junkbuf);
+}
+void
+/* VARARGS1 */
+addprintf1 (str, a, b, c, d, e, f, g, h)
+char *str;
+char *a;
+int b, c, d, e, f, g, h;
+{
+ char junkbuf[STRSIZE];
+
+ (void) sprintf (junkbuf, str, a, b, c, d, e, f, g, h);
+ (void) addstr (junkbuf);
+}
+void
+/* VARARGS1 */
+addprintf2 (str, a, b, c, d, e, f, g, h)
+char *str;
+char *a, *e, *f;
+int b, c, d, g, h;
+{
+ char junkbuf[STRSIZE];
+
+ (void) sprintf (junkbuf, str, a, b, c, d, e, f, g, h);
+ (void) addstr (junkbuf);
+}
+
+/*
+Print a single cell in condensed format.
+*/
+
+extern char zoom_list[];
+
+void
+print_movie_cell (mbuf, row, col, row_inc, col_inc)
+char *mbuf;
+int row, col;
+int row_inc, col_inc;
+{
+ int r, c;
+ char cell;
+
+ cell = ' ';
+ for (r = row; r < row + row_inc; r++)
+ for (c = col; c < col + col_inc; c++)
+ if (strchr (zoom_list, mbuf[row_col_loc(r,c)])
+ < strchr (zoom_list, cell))
+ cell = mbuf[row_col_loc(r,c)];
+
+ (void) move (row/row_inc + NUMTOPS, col/col_inc);
+ (void) addch ((chtype)cell);
+}
edit.c -- Routines to handle edit mode commands.
*/
+#include <stdio.h>
#ifdef SYSV
#include <string.h>
#else
-/* $Id: empire.c,v 1.3 1994/12/01 15:54:33 esr Exp esr $ - (c) Copyright 1987, 1988 Chuck Simmons */
+/* $Id: empire.c,v 1.4 2000/07/28 05:12:51 esr Exp esr $ - (c) Copyright 1987, 1988 Chuck Simmons */
/*
* Copyright (C) 1987, 1988 Chuck Simmons
clear_screen (); /* nothing on screen */
(void) move (7, 0);
- ver ();
+ version ();
pos_str (8, 0, "Detailed directions are in EMPIRE.DOC\n",0,0,0,0,0,0,0,0);
(void) refresh ();
-/* $Id: extern.h,v 1.6 2002/08/01 18:58:21 esr Exp esr $ - (c) Copyright 1987, 1988 Chuck Simmons */
+/* $Id: extern.h,v 1.7 2006/07/25 15:19:49 esr Exp esr $ - (c) Copyright 1987, 1988 Chuck Simmons */
/*
* Copyright (C) 1987, 1988 Chuck Simmons
#ifdef A_COLOR
void init_colors ();
#endif /* A_COLOR */
+void redraw ();
+void clear_screen ();
+void delay ();
+void close_disp ();
+void pos_str (int row, int col, char *str, int a, int b, int c, int d, int e, int f, int g, int h);
+void pos_str1 (int row, int col, char *str, char *a, int b, int c, int d, int e, int f, int g, int h);
+void addprintf (char *str, int a, int b, int c, int d, int e, int f, int g, int h);
+void addprintf1 (char *str, char *a, int b, int c, int d, int e, int f, int g, int h);
+void addprintf2 (char *str, char *a, int b, int c, int d, char *e, char *f, int g, int h);
void init_game (); /* game routines */
void save_game ();
/* utility routines */
void ttinit ();
-void redraw ();
-void clear_screen ();
-void delay ();
-void close_disp ();
-void pos_str (int row, int col, char *str, int a, int b, int c, int d, int e, int f, int g, int h);
-void pos_str1 (int row, int col, char *str, char *a, int b, int c, int d, int e, int f, int g, int h);
-void addprintf (char *str, int a, int b, int c, int d, int e, int f, int g, int h);
-void addprintf1 (char *str, char *a, int b, int c, int d, int e, int f, int g, int h);
-void addprintf2 (char *str, char *a, int b, int c, int d, char *e, char *f, int g, int h);
void assert (char *expression, char *file, int line);
void empend ();
-void ver ();
+void version ();
char upper (char c);
void tupper (char *str);
void check ();
#include <strings.h>
#endif
+#include <stdio.h>
#include <ctype.h>
-#include <curses.h>
#include "empire.h"
#include "extern.h"
pos_str (0, 0, "Round %3d", (round + 1) / 2,0,0,0,0,0,0,0);
}
-/*
-Print a single cell in condensed format.
-*/
-
-extern char zoom_list[];
-
-void
-print_movie_cell (mbuf, row, col, row_inc, col_inc)
-char *mbuf;
-int row, col;
-int row_inc, col_inc;
-{
- int r, c;
- char cell;
-
- cell = ' ';
- for (r = row; r < row + row_inc; r++)
- for (c = col; c < col + col_inc; c++)
- if (strchr (zoom_list, mbuf[row_col_loc(r,c)])
- < strchr (zoom_list, cell))
- cell = mbuf[row_col_loc(r,c)];
-
- (void) move (row/row_inc + NUMTOPS, col/col_inc);
- (void) addch ((chtype)cell);
-}
usermove.c -- Let the user move her troops.
*/
-#include <curses.h>
+#include <stdio.h>
#include <ctype.h>
#include "empire.h"
#include "extern.h"
-/* $Id: util.c,v 1.3 2000/07/28 05:12:54 esr Exp esr $ - (c) Copyright 1987, 1988 Chuck Simmons */
+/* $Id: util.c,v 1.4 2006/07/25 15:20:30 esr Exp esr $ - (c) Copyright 1987, 1988 Chuck Simmons */
/*
* Copyright (C) 1987, 1988 Chuck Simmons
util.c -- various utility routines.
*/
-#include <curses.h>
+#include <stdio.h>
#include <ctype.h>
#include <signal.h>
#include "empire.h"
else return c;
}
-/*
-Clear the end of a specified line starting at the specified column.
-*/
-
-void
-clreol(linep, colp)
-int linep, colp;
-{
- (void) move (linep, colp);
- (void) clrtoeol();
-}
-
-/*
-Initialize the terminal.
-*/
-
-void
-ttinit()
-{
- (void) initscr();
- (void) noecho();
- (void) crmode();
-#ifdef A_COLOR
- init_colors();
-#endif /* A_COLOR */
- lines = LINES;
- cols = COLS;
- if (lines > MAP_HEIGHT + NUMTOPS + 1)
- lines = MAP_HEIGHT + NUMTOPS + 1;
- if (cols > MAP_WIDTH + NUMSIDES)
- cols = MAP_WIDTH + NUMSIDES;
-}
-
-
-/*
-Clear the screen. We must also kill information maintained about the
-display.
-*/
-
-void
-clear_screen () {
- (void) clear ();
- (void) refresh ();
- kill_display ();
-}
-
-/*
-Redraw the screen.
-*/
-
-void
-redraw () {
- (void) clearok (curscr, TRUE);
- (void) refresh ();
-}
-
-/*
-Wait a little bit to give user a chance to see a message. We refresh
-the screen and pause for a few milliseconds.
-*/
-
-void
-delay () {
- int t = delay_time;
- int i = 500;
- (void) refresh ();
- if (t > i) {
- (void) move (LINES - 1, 0);
- }
- for (; t > 0; t -= i) {
- (void) napms ((t > i) ? i : t); /* pause a bit */
- if (t > i) {
- addstr ("*");
- refresh ();
- }
- }
-}
-
-/*
-Clean up the display. This routine gets called as we leave the game.
-*/
-
-void
-close_disp()
-{
- (void) move (LINES - 1, 0);
- (void) clrtoeol ();
- (void) refresh ();
- (void) endwin ();
-}
-
-/*
-Position the cursor and output a string.
-*/
-
-void
-pos_str1 (row, col, str, a, b, c, d, e, f, g, h)
-int row, col;
-char *str, *a;
-int b, c, d, e, f, g, h;
-{
- (void) move (row, col);
- addprintf1 (str, a, b, c, d, e, f, g, h);
-}
-void
-pos_str (row, col, str, a, b, c, d, e, f, g, h)
-int row, col;
-char *str;
-int a, b, c, d, e, f, g, h;
-{
- (void) move (row, col);
- addprintf (str, a, b, c, d, e, f, g, h);
-}
-
-void
-/* VARARGS1 */
-addprintf (str, a, b, c, d, e, f, g, h)
-char *str;
-int a, b, c, d, e, f, g, h;
-{
- char junkbuf[STRSIZE];
-
- (void) sprintf (junkbuf, str, a, b, c, d, e, f, g, h);
- (void) addstr (junkbuf);
-}
-void
-/* VARARGS1 */
-addprintf1 (str, a, b, c, d, e, f, g, h)
-char *str;
-char *a;
-int b, c, d, e, f, g, h;
-{
- char junkbuf[STRSIZE];
-
- (void) sprintf (junkbuf, str, a, b, c, d, e, f, g, h);
- (void) addstr (junkbuf);
-}
-void
-/* VARARGS1 */
-addprintf2 (str, a, b, c, d, e, f, g, h)
-char *str;
-char *a, *e, *f;
-int b, c, d, g, h;
-{
- char junkbuf[STRSIZE];
-
- (void) sprintf (junkbuf, str, a, b, c, d, e, f, g, h);
- (void) addstr (junkbuf);
-}
-
/*
Report a bug.
*/
*/
void
-ver ()
+version ()
{
(void) addstr ("EMPIRE, Version 5.00 site Amdahl 1-Apr-1988");
}