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

Comparing ray/src/hd/rhdisp.c (file contents):
Revision 3.1 by gregl, Wed Nov 19 18:01:03 1997 UTC vs.
Revision 3.2 by gregl, Thu Nov 20 18:05:57 1997 UTC

# Line 39 | Line 39 | char   *argv[];
39                                          /* enter main loop */
40          do {
41                  rdy = disp_wait();
42 <                if (rdy & DEV_READY) {
42 >                while (rdy & DEV_READY) {
43                          inp = dev_input();      /* take residual action here */
44 +                        if (inp & DEV_NEWVIEW)
45 +                                new_view(&odev.v);
46                          if (inp & DEV_SHUTDOWN)
47                                  serv_request(DR_SHUTDOWN, 0, NULL);
48 <                        else if (inp & DEV_NEWVIEW)
49 <                                new_view(&odev.v);
48 >                        if (inp & DEV_WAIT)
49 >                                serv_request(DR_ATTEN, 0, NULL);
50 >                        else
51 >                                rdy &= ~DEV_READY;
52                  }
53 <                if (rdy & SERV_READY)
53 >                if (rdy & SERV_READY) {
54                          res = serv_result();    /* processes result, also */
55 +                        if (res == DS_ACKNOW)
56 +                                serv_request(DR_NOOP, 0, NULL);
57 +                }
58          } while (res != DS_SHUTDOWN);
59                                          /* all done */
60          quit(0);
# Line 229 | Line 236 | char   *p;
236                  fwrite(p, 1, nbytes, stdout);
237          if (fflush(stdout) < 0)
238                  error(SYSTEM, "write error in serv_request");
239 + }
240 +
241 +
242 + eputs(s)                        /* put error message to stderr */
243 + register char  *s;
244 + {
245 +        static int  midline = 0;
246 +
247 +        if (!*s)
248 +                return;
249 +        if (!midline++) {       /* prepend line with program name */
250 +                fputs(progname, stderr);
251 +                fputs(": ", stderr);
252 +        }
253 +        fputs(s, stderr);
254 +        if (s[strlen(s)-1] == '\n') {
255 +                fflush(stderr);
256 +                midline = 0;
257 +        }
258   }
259  
260  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines