]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - hack/hack.track.c
6b41c2cdb118c41ffa3c47cf5f737ff28a423b84
1 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
2 /* hack.track.c - version 1.0.2 */
18 if(utcnt
< UTSZ
) utcnt
++;
19 if(utpnt
== UTSZ
) utpnt
= 0;
20 utrack
[utpnt
].x
= u
.ux
;
21 utrack
[utpnt
].y
= u
.uy
;
26 gettrack(x
,y
) register x
,y
; {
27 register int i
,cnt
,dist
;
30 for(i
= utpnt
-1; cnt
--; i
--){
31 if(i
== -1) i
= UTSZ
-1;
33 dist
= (x
-tc
.x
)*(x
-tc
.x
) + (y
-tc
.y
)*(y
-tc
.y
);
35 return(dist
? &(utrack
[i
]) : 0);