ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/xshowtrace.c
(Generate patch)

Comparing ray/src/px/xshowtrace.c (file contents):
Revision 1.1 by greg, Sat Sep 22 10:53:57 1990 UTC vs.
Revision 1.2 by greg, Sat Sep 22 18:53:15 1990 UTC

# Line 34 | Line 34 | struct node {                          /* ray tree node */
34  
35   #define newnode()       (struct node *)calloc(1, sizeof(struct node))
36  
37 + int     slow = 0;               /* slow trace? */
38  
39 +
40   main(argc, argv)                /* takes both the octree and the image */
41   int     argc;
42   char    *argv[];
# Line 44 | Line 46 | char   *argv[];
46          Cursor  curs;
47  
48          progname = argv[0];
49 <        if (argc < 3) {
50 <                fprintf(stderr, "Usage: %s [rtrace args] octree picture\n",
49 >        for (i = 1; i < argc-2; i++)
50 >                if (!strcmp(argv[i], "-s"))
51 >                        slow++;
52 >                else
53 >                        break;
54 >        if (i > argc-2) {
55 >                fprintf(stderr, "Usage: %s [-s] [rtrace args] octree picture\n",
56                                  argv[0]);
57                  exit(1);
58          }
# Line 65 | Line 72 | char   *argv[];
72          }
73                                          /* build input command */
74          sprintf(combuf, "%s %s | %s", xicom, argv[argc-1], rtcom);
75 <        for (i = 1; i < argc-1; i++) {
75 >        for ( ; i < argc-1; i++) {
76                  strcat(combuf, " ");
77                  strcat(combuf, argv[i]);
78          }
# Line 109 | Line 116 | mainloop()                             /* get and process input */
116                  if (i == 0) {
117                          setvec(sis[0]->ipt);
118                          tracerays(sis[0]);
112                        XFlush(theDisplay);
119                          freetree(sis[0]);
120                          sis[0] = NULL;
121 +                        if (!slow)
122 +                                XFlush(theDisplay);
123                  }
124          }
125   }
# Line 134 | Line 142 | struct node    *tp;
142          register struct node    *kid;
143  
144          for (kid = tp->daughter; kid != NULL; kid = kid->sister) {
137                tracerays(kid);
145                  vector(tp->ipt, kid->ipt);
146 +                tracerays(kid);
147          }
148   }
149  
# Line 199 | Line 207 | double ip1[2], ip2[2];
207          XDrawLine(theDisplay, gwind, vecGC,
208                          (int)(ip1[0]*xres)+xoff, (int)((1.-ip1[1])*yres)+yoff,
209                          (int)(ip2[0]*xres)+xoff, (int)((1.-ip2[1])*yres)+yoff);
210 +        if (slow) {
211 +                XFlush(theDisplay);
212 +                sleep(1);
213 +        }
214   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines