From c8f87ff41829ef93122a0d1512e5f705d8c476ea Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 25 Jul 2006 16:43:14 +0000 Subject: [PATCH] More factoring out of the display interface. --- display.c | 7 ++++++- empire.c | 20 ++++++++++++-------- extern.h | 7 ++++--- util.c | 15 +-------------- 4 files changed, 23 insertions(+), 26 deletions(-) diff --git a/display.c b/display.c index 99abea7..9e46067 100644 --- a/display.c +++ b/display.c @@ -1,4 +1,4 @@ -/* $Id: display.c,v 1.8 2002/04/19 09:17:01 esr Exp esr $ - (c) Copyright 1987, 1988 Chuck Simmons */ +/* $Id: display.c,v 1.9 2006/07/25 15:59:54 esr Exp esr $ - (c) Copyright 1987, 1988 Chuck Simmons */ /* * Copyright (C) 1987, 1988 Chuck Simmons @@ -564,6 +564,11 @@ clear_screen () { Redraw the screen. */ +void +redisplay () { + (void) refresh (); +} + void redraw () { (void) clearok (curscr, TRUE); diff --git a/empire.c b/empire.c index dadd14a..db5e75a 100644 --- a/empire.c +++ b/empire.c @@ -1,4 +1,4 @@ -/* $Id: empire.c,v 1.4 2000/07/28 05:12:51 esr Exp esr $ - (c) Copyright 1987, 1988 Chuck Simmons */ +/* $Id: empire.c,v 1.5 2006/07/25 15:59:54 esr Exp esr $ - (c) Copyright 1987, 1988 Chuck Simmons */ /* * Copyright (C) 1987, 1988 Chuck Simmons @@ -13,12 +13,19 @@ parser, and the simple commands. */ #include -#include #include "empire.h" #include "extern.h" void c_examine(), c_movie(); +/* + * 03a 01Apr88 aml .Hacked movement algorithms for computer. + * 02b 01Jun87 aml .First round of bug fixes. + * 02a 01Jan87 aml .Translated to C. + * 01b 27May85 cal .Fixed round number update bug. Made truename simple. + * 01a 01Sep83 cal .Taken from a Decus tape + */ + void empire () { void do_command(); @@ -31,8 +38,7 @@ empire () { rndini (); /* init random number generator */ clear_screen (); /* nothing on screen */ - (void) move (7, 0); - version (); + pos_str (7, 0, "EMPIRE, Version 5.00 site Amdahl 1-Apr-1988",0,0,0,0,0,0,0,0); pos_str (8, 0, "Detailed directions are in EMPIRE.DOC\n",0,0,0,0,0,0,0,0); (void) refresh (); @@ -50,7 +56,7 @@ empire () { } else { prompt (0,0,0,0,0,0,0,0,0); /* blank top line */ - (void) refresh (); + void redisplay(); prompt ("Your orders? ",0,0,0,0,0,0,0,0); order = get_chx (); /* get a command */ do_command (order); @@ -152,11 +158,9 @@ char orders; if (resigned || debug) replay_movie (); else error ("You cannot watch movie until computer resigns.",0,0,0,0,0,0,0,0); break; - + case 'Z': /* print compressed map */ - (void) clear (); print_zoom (user_map); - (void) refresh (); break; case '\014': /* redraw the screen */ diff --git a/extern.h b/extern.h index 978fdf9..ae71ec0 100644 --- a/extern.h +++ b/extern.h @@ -1,4 +1,4 @@ -/* $Id: extern.h,v 1.7 2006/07/25 15:19:49 esr Exp esr $ - (c) Copyright 1987, 1988 Chuck Simmons */ +/* $Id: extern.h,v 1.8 2006/07/25 15:59:54 esr Exp esr $ - (c) Copyright 1987, 1988 Chuck Simmons */ /* * Copyright (C) 1987, 1988 Chuck Simmons @@ -139,7 +139,9 @@ int rmap_shore (long loc); int vmap_at_sea (view_map_t *vmap, long loc); int rmap_at_sea (long loc); -void kill_display (); /* display routines */ +/* display routines */ +void redisplay(); +void kill_display (); void sector_change (); int cur_sector (); long cur_cursor (); @@ -230,7 +232,6 @@ void ksend1 (char *buf, char *a, int b, int c, int d, int e, int f, int g, int h void ttinit (); void assert (char *expression, char *file, int line); void empend (); -void version (); char upper (char c); void tupper (char *str); void check (); diff --git a/util.c b/util.c index f7efa50..e53670b 100644 --- a/util.c +++ b/util.c @@ -1,4 +1,4 @@ -/* $Id: util.c,v 1.4 2006/07/25 15:20:30 esr Exp esr $ - (c) Copyright 1987, 1988 Chuck Simmons */ +/* $Id: util.c,v 1.5 2006/07/25 15:59:54 esr Exp esr $ - (c) Copyright 1987, 1988 Chuck Simmons */ /* * Copyright (C) 1987, 1988 Chuck Simmons @@ -80,19 +80,6 @@ empend () exit (0); } -/* - * 03a 01Apr88 aml .Hacked movement algorithms for computer. - * 02b 01Jun87 aml .First round of bug fixes. - * 02a 01Jan87 aml .Translated to C. - * 01b 27May85 cal .Fixed round number update bug. Made truename simple. - * 01a 01Sep83 cal .Taken from a Decus tape - */ - -void -version () -{ - (void) addstr ("EMPIRE, Version 5.00 site Amdahl 1-Apr-1988"); -} /* Here is a little routine to perform consistency checking on the -- 2.43.0