X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=blobdiff_plain;f=src%2Fsst.h;h=07e7a2bc37d3516b143435e31bc7bdd7cd9a16b7;hp=1c40d1b946d43a3e932b0814c363decca37f4e49;hb=093f7d420e9cf92fbaf751f57a199c56562ae4b5;hpb=ad1478c7cc24b761592a1e355015b44b243aeeda diff --git a/src/sst.h b/src/sst.h index 1c40d1b..07e7a2b 100644 --- a/src/sst.h +++ b/src/sst.h @@ -42,7 +42,9 @@ typedef struct {int x; int y;} coord; -#define same(c1, c2) (c1.x == c2.x && c1.y == c2.y) +#define square(i) ((i)*(i)) +#define same(c1, c2) ((c1.x == c2.x) && (c1.y == c2.y)) +#define distance(c1, c2) sqrt(square(c1.x - c2.x) + square(c1.y - c2.y)) typedef struct { coord w; @@ -355,7 +357,7 @@ void finish(FINTYPE); void selfdestruct(void); void kaboom(void); void freeze(bool); -int thaw(void); +bool thaw(void); void plaque(void); int scan(void); #define IHEOL (0) @@ -374,9 +376,8 @@ void crmshp(void); char *cramlc(enum loctype, coord w); double expran(double); double Rand(void); -void iran(int, int *, int *); -#define square(i) ((i)*(i)) -void dropin(int, coord*); +coord iran(int); +coord dropin(int); void newcnd(void); void sortkl(void); void imove(void); @@ -419,7 +420,7 @@ void commandhook(char *, bool); void makechart(void); void enqueue(char *); char *systemname(int); -void newkling(int, coord *); +coord newkling(int); /* mode arguments for srscan() */ #define SCAN_FULL 1