aboutsummaryrefslogtreecommitdiff
path: root/pkg/images/tv/tvmark/mknew.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /pkg/images/tv/tvmark/mknew.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'pkg/images/tv/tvmark/mknew.x')
-rw-r--r--pkg/images/tv/tvmark/mknew.x42
1 files changed, 42 insertions, 0 deletions
diff --git a/pkg/images/tv/tvmark/mknew.x b/pkg/images/tv/tvmark/mknew.x
new file mode 100644
index 00000000..27a5a3af
--- /dev/null
+++ b/pkg/images/tv/tvmark/mknew.x
@@ -0,0 +1,42 @@
+# MK_NEW -- Procedure to determine whether the current star is the same as
+# the previous star and/or whether the current star belongs to the coordinate
+# list or not.
+
+int procedure mk_new (wx, wy, owx, owy, xlist, ylist, newlist)
+
+real wx # x cursor coordinate
+real wy # y cursor coordinate
+real owx # old x cursor coordinate
+real owy # old y cursor coordinate
+real xlist # x list coordinate
+real ylist # y list coordinate
+int newlist # integer new list
+
+int newobject
+real deltaxy
+bool fp_equalr()
+
+begin
+ deltaxy = 1.0
+
+ if (newlist == NO) {
+ if (! fp_equalr (wx, owx) || ! fp_equalr (wy, owy))
+ newobject = YES
+ else
+ newobject = NO
+ } else if ((abs (xlist - wx) <= deltaxy) &&
+ (abs (ylist - wy) <= deltaxy)) {
+ wx = xlist
+ wy = ylist
+ newobject = NO
+ } else if (fp_equalr (wx, owx) && fp_equalr (wy, owy)) {
+ wx = xlist
+ wy = ylist
+ newobject = NO
+ } else {
+ newlist = NO
+ newobject = YES
+ }
+
+ return (newobject)
+end