From 4a5bcd72352292e038b55645a1d6207407b30f71 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 4 Nov 2004 23:17:07 +0000 Subject: [PATCH] curses interface is now partly working. --- events.c | 4 ++-- makefile | 2 +- moving.c | 6 +++--- reports.c | 2 +- sst.c | 5 +++-- sst.h | 5 ++++- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/events.c b/events.c index c3f22f5..940ad7b 100644 --- a/events.c +++ b/events.c @@ -580,7 +580,7 @@ void nova(int ix, int iy) { skip(1); prout("Force of nova displaces starship."); iattak=2; /* Eliminates recursion problem */ - move(); + imove(); Time = 10.0*dist/16.0; return; } @@ -635,7 +635,7 @@ void snova(int insx, int insy) { if (game.damage[DRADIO] == 0.0 || condit == IHDOCKED) { skip(1); prout("Message from Starfleet Command Stardate %.2f", game.state.date); - proutn(" Supernova in %s; caution advised.", + prout(" Supernova in %s; caution advised.", cramlc(quadrant, nqx, nqy)); } } diff --git a/makefile b/makefile index f98e173..cf29f5a 100644 --- a/makefile +++ b/makefile @@ -18,7 +18,7 @@ SOURCES= $(CFILES) $(HFILES) $(DOCS) sst.doc sst.6 makehelp.py makefile sst.spec all: sst sst.doc sst: $(OFILES) - gcc -o sst $(OFILES) -lm + gcc -o sst $(OFILES) -lm -lcurses $(OFILES): $(HFILES) diff --git a/moving.c b/moving.c index c48ded5..07eb148 100644 --- a/moving.c +++ b/moving.c @@ -2,7 +2,7 @@ static void getcd(int, int); -void move(void) { +void imove(void) { double angle, deltax, deltay, bigger, x, y, finald, finalx, finaly, stopegy; int trbeam = 0, n, l, ix, iy, kink, kinks, iquad; @@ -447,7 +447,7 @@ void impuls(void) { if (ja() == 0) return; } /* Activate impulse engines and pay the cost */ - move(); + imove(); ididit = 1; if (alldone) return; power = 20.0 + 100.0*dist; @@ -575,7 +575,7 @@ void warp(int i) { /* Activate Warp Engines and pay the cost */ - move(); + imove(); if (alldone) return; energy -= dist*warpfac*warpfac*warpfac*(shldup+1); if (energy <= 0) finish(FNRG); diff --git a/reports.c b/reports.c index f98c35c..e398e77 100644 --- a/reports.c +++ b/reports.c @@ -130,7 +130,7 @@ void lrscan(void) { game.starch[x][y] = game.damage[DRADIO] > 0 ? game.state.galaxy[x][y]+1000 :1; } } - putchar('\n'); + skip(1); } } diff --git a/sst.c b/sst.c index f65a2a5..8d82100 100644 --- a/sst.c +++ b/sst.c @@ -348,8 +348,8 @@ int main(int argc, char **argv) { int hitme; char ch; - prelim(); iostart(); + prelim(); line[0] = '\0'; if (argc > 1) { while (--argc > 0) { @@ -380,7 +380,8 @@ int main(int argc, char **argv) { if (!ja()) break; } skip(1); - prout("May the Great Bird of the Galaxy roost upon your home planet."); + ioend(); + puts("May the Great Bird of the Galaxy roost upon your home planet."); } diff --git a/sst.h b/sst.h index b5ad3e4..f9eb043 100644 --- a/sst.h +++ b/sst.h @@ -316,8 +316,10 @@ char *device[NDEVICES+1] = { "D. S. Probe"}; #endif +#ifndef TRUE #define TRUE (1) #define FALSE (0) +#endif #define IHR 'R' #define IHK 'K' @@ -392,7 +394,7 @@ double square(double); void dropin(int, int*, int*); void newcnd(void); void sortkl(void); -void move(void); +void imove(void); void ram(int, int, int, int); void crmena(int, int, int, int, int); void deadkl(int, int, int, int, int); @@ -422,4 +424,5 @@ void movetho(void); void probe(void); void clearscreen(void); void iostart(void); +void ioend(void); void getline(char *, int); -- 2.31.1