]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - hack/hack.track.c
2 * Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
6 static char rcsid
[] = "$NetBSD: hack.track.c,v 1.3 1995/03/23 08:31:42 cgd Exp $";
23 if(utcnt
< UTSZ
) utcnt
++;
24 if(utpnt
== UTSZ
) utpnt
= 0;
25 utrack
[utpnt
].x
= u
.ux
;
26 utrack
[utpnt
].y
= u
.uy
;
31 gettrack(x
,y
) register x
,y
; {
32 register int i
,cnt
,dist
;
35 for(i
= utpnt
-1; cnt
--; i
--){
36 if(i
== -1) i
= UTSZ
-1;
38 dist
= (x
-tc
.x
)*(x
-tc
.x
) + (y
-tc
.y
)*(y
-tc
.y
);
40 return(dist
? &(utrack
[i
]) : 0);