# Use -g to compile the program for debugging.
#DEBUG = -g -DDEBUG -Wall
-DEBUG = -O2
+DEBUG = -O2 -Wall
# Use -p to profile the program.
#PROFILE = -p -DPROFILE
vms-empire news
1.10:
- Fix core dump wehen a satellite bounced off the world edge.
+ Fix core dump when a satellite bounced off the world edge.
Full ANSIfication of function prototypes (which fixed the
sat bug - the code appeasrs to have been tickling some obscure
bug in the compilation of function calls with K&R-style prototypes).
*/
#include <string.h>
-#include <curses.h> /* Ugh...shouldn't be needed here */
#include <stdbool.h>
#include "empire.h"
#include "extern.h"
check_endgame (); /* see if game is over */
topini ();
- (void) refresh ();
+ (void) redisplay ();
}
}
loc_t new_loc;
path_map_t path_map2[MAP_SIZE];
loc_t new_loc2;
- int cross_cost; /* cost to enter water */
+ int cross_cost = 0; /* cost to enter water */
obj->func = 0; /* army doesn't want a tt */
if (vmap_at_sea (comp_map, obj->loc)) { /* army can't move? */
kill_display ();
}
+/*
+Audible complaint.
+*/
+
+void
+complain(void)
+{
+ (void) beep ();
+}
+
/*
Redraw the screen.
*/
*/
#include <stdio.h>
-#include <curses.h> /* Ugh...shouldn't be needed here */
#include "empire.h"
#include "extern.h"
clear_screen (); /* nothing on screen */
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 ();
+ (void) redisplay ();
if (!restore_game ()) /* try to restore previous game */
init_game (); /* otherwise init a new game */
#endif /* A_COLOR */
void redraw (void);
void clear_screen (void);
+void complain (void);
void delay (void);
void close_disp (void);
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);
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
-#include <curses.h> /* Ugh...shouldn't be needed here */
#include "empire.h"
#include "extern.h"
for (c = 0; c < MAP_WIDTH; c += col_inc)
print_movie_cell (mapbuf, r, c, row_inc, col_inc);
- (void) refresh ();
+ (void) redisplay ();
delay ();
}
(void) fclose (f);
#include <stdio.h>
#include <ctype.h>
#include <string.h>
-#include <curses.h> /* Ugh...shouldn't be needed here */
#include "empire.h"
#include "extern.h"
}
if (cur_sector () == sec) { /* is sector displayed? */
print_sector_u (sec); /* make screen up-to-date */
- (void) refresh (); /* show it to the user */
+ redisplay (); /* show it to the user */
}
}
if (save_movie) save_movie_screen ();
ask_user (obj);
topini (); /* clear info lines */
display_loc_u (obj->loc); /* let user see result */
- (void) refresh ();
+ (void) redisplay ();
need_input = FALSE; /* we got it */
}
case 'P': user_redraw (); break;
case '?': describe_obj (obj); break;
- default: (void) beep ();
+ default: complain ();
}
}
}
void
user_fill(piece_info_t *obj)
{
- if (obj->type != TRANSPORT && obj->type != CARRIER) (void) beep ();
+ if (obj->type != TRANSPORT && obj->type != CARRIER) complain ();
else obj->func = FILL;
}
case 'X': obj->func = MOVE_S ; break;
case 'Z': obj->func = MOVE_SW; break;
case 'A': obj->func = MOVE_W ; break;
- default: (void) beep (); break;
+ default: complain (); break;
}
}
void
user_land(piece_info_t *obj)
{
- if (obj->type != FIGHTER) (void) beep ();
+ if (obj->type != FIGHTER) complain ();
else obj->func = LAND;
}
void
user_transport(piece_info_t *obj)
{
- if (obj->type != ARMY) (void) beep ();
+ if (obj->type != ARMY) complain ();
else obj->func = WFTRANSPORT;
}
void
user_armyattack(piece_info_t *obj)
{
- if (obj->type != ARMY) (void) beep ();
+ if (obj->type != ARMY) complain ();
else obj->func = ARMYATTACK;
}
void
user_repair(piece_info_t *obj)
{
- if (obj->type == ARMY || obj->type == FIGHTER) (void) beep ();
+ if (obj->type == ARMY || obj->type == FIGHTER) complain ();
else obj->func = REPAIR;
}
cityp = find_city (obj->loc);
if (!cityp || cityp->owner != USER) {
- (void) beep ();
+ complain ();
return;
}
type = get_piece_name();
if (type == NOPIECE) {
- (void) beep ();
+ complain ();
return;
}
e_city_attack (cityp, type);
break;
default: /* bad command? */
- (void) beep ();
+ complain ();
break;
}
}
city_info_t *cityp;
if (user_map[obj->loc].contents != 'O') { /* no user city here? */
- (void) beep ();
+ complain ();
return;
}
cityp = find_city (obj->loc);