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

Comparing ray/src/hd/rholo.c (file contents):
Revision 3.3 by gregl, Fri Oct 31 15:49:23 1997 UTC vs.
Revision 3.4 by gregl, Mon Nov 3 18:33:12 1997 UTC

# Line 127 | Line 127 | initrholo()                    /* get our holodeck running */
127   {
128          extern int      global_packet();
129          register int    i;
130 <                                                /* check output device */
131 <        if (outdev != NULL)
132 <                open_display(outdev);
130 >
131 >        if (outdev != NULL)                     /* open output device */
132 >                disp_open(outdev);
133          else if (ncprocs > 0)                   /* else use global ray feed */
134                  init_global();
135                                                  /* record end time */
# Line 187 | Line 187 | rholo()                                /* holodeck main loop */
187          register PACKET *p;
188          time_t  t;
189          long    l;
190 <                                        /* check display */
191 <        if (outdev != NULL && !disp_check(idle))
192 <                return(0);
190 >
191 >        if (outdev != NULL)             /* check display */
192 >                if (!disp_check(idle))
193 >                        return(0);
194                                          /* display only? */
195          if (ncprocs <= 0)
196                  return(1);
# Line 367 | Line 368 | loadholo()                     /* start loading a holodeck from fname */
368   {
369          FILE    *fp;
370          long    endloc;
371 <                                        /* open input file */
372 <        if ((fp = fopen(hdkfile, "r+")) == NULL) {
373 <                sprintf(errmsg, "cannot open \"%s\" for appending", hdkfile);
371 >                                        /* open holodeck file */
372 >        if ((fp = fopen(hdkfile, ncprocs>0 ? "r+" : "r")) == NULL) {
373 >                sprintf(errmsg, "cannot open \"%s\" for %s", hdkfile,
374 >                                ncprocs>0 ? "appending" : "reading");
375                  error(SYSTEM, errmsg);
376          }
377                                          /* load variables from header */
# Line 514 | Line 516 | int    ec;
516   {
517          int     status = 0;
518  
519 +        if (outdev != NULL)             /* close display */
520 +                disp_close();
521          if (hdlist[0] != NULL) {        /* flush holodeck */
522                  if (ncprocs > 0) {
523                          done_packets(flush_queue());

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines