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

Comparing ray/src/util/glrad.c (file contents):
Revision 3.14 by greg, Mon May 19 16:32:19 2003 UTC vs.
Revision 3.15 by schorsch, Thu Jun 26 00:58:11 2003 UTC

# Line 12 | Line 12 | static const char      RCSid[] = "$Id$";
12   #endif
13   #include <ctype.h>
14   #include <time.h>
15 +
16   #include "radogl.h"
17   #include "view.h"
18   #include "paths.h"
19   #include "glradicon.h"
20 + #include "rtprocess.h"
21  
22   #ifndef MAXVIEW
23   #define MAXVIEW         63              /* maximum number of standard views */
# Line 72 | Line 74 | char   *scene[MAXSCENE+1];             /* material and scene file l
74   int     nscenef = 0;                    /* number of scene files */
75   char    *octree;                        /* octree name (NULL if unnec.) */
76  
77 < int     rtpd[3];                        /* rtrace process descriptors */
77 > SUBPROC rtpd;                   /* rtrace process descriptors */
78  
79   int     silent = 0;                     /* run rad silently? */
80   int     backvis = 1;                    /* back faces visible? */
# Line 179 | Line 181 | int    code;
181   {
182          if (ourdisplay != NULL)
183                  dev_close();
184 <        if (rtpd[2] > 0) {
185 <                if (close_process(rtpd) > 0)
184 >        /* if (rtpd.pid > 0) { */
185 >        if (rtpd.running) {
186 >                if (close_process(&rtpd) > 0)
187                          wputs("bad exit status from rtrace\n");
188 <                rtpd[2] = 0;
188 >                /* rtpd.pid = 0; */
189          }
190          exit(code);
191   }
# Line 198 | Line 201 | char   *octname;
201          if (nowarn) av[ac++] = "-w-";
202          av[ac++] = octname;
203          av[ac] = NULL;
204 <        if (open_process(rtpd, av) <= 0)
204 >        if (open_process(&rtpd, av) <= 0)
205                  error(SYSTEM, "cannot start rtrace process");
206   }
207  
# Line 675 | Line 678 | double md;
678   {
679          float   fbuf[6];
680                                  /* check to see if rtrace is running */
681 <        if (rtpd[2] <= 0)
681 >        /* if (rtpd.pid <= 0) */
682 >        if (!rtpd.running)
683                  return(0);
684                                  /* assign origin */
685          fbuf[0] = org[0]; fbuf[1] = org[1]; fbuf[2] = org[2];
# Line 683 | Line 687 | double md;
687          if (md <= FTINY) md = FHUGE;
688          fbuf[3] = dir[0]*md; fbuf[4] = dir[1]*md; fbuf[5] = dir[2]*md;
689                                  /* trace that ray */
690 <        if (process(rtpd, (char *)fbuf, (char *)fbuf,
690 >        if (process(&rtpd, (char *)fbuf, (char *)fbuf,
691                          4*sizeof(float), 6*sizeof(float)) != 4*sizeof(float))
692                  error(INTERNAL, "error getting data back from rtrace process");
693          if (fbuf[3] >= .99*FHUGE)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines