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.38 by gwlarson, Sun Dec 20 20:39:31 1998 UTC vs.
Revision 3.42 by gwlarson, Thu Jul 29 15:38:40 1999 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1998 Silicon Graphics, Inc. */
1 > /* Copyright (c) 1999 Silicon Graphics, Inc. */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ SGI";
# Line 22 | Line 22 | static char SCCSid[] = "$SunId$ SGI";
22   #define FSIZDEF         0.125   /* default focus frame size */
23   #endif
24  
25 + #ifdef linux
26 + #define fbufcnt(f)      ((f)->_IO_read_end - (f)->_IO_read_ptr)
27 + #else
28 + #define fbufcnt(f)      ((f)->_cnt)
29 + #endif
30 +
31   HOLO    *hdlist[HDMAX+1];       /* global holodeck list */
32  
33   char    *hdgfn[HDMAX];          /* holodeck section geometry list */
# Line 40 | Line 46 | char   *progname;              /* global argv[0] */
46   FILE    *sstdin, *sstdout;      /* server's standard input and output */
47  
48   #ifdef DEBUG
43 #include <sys/types.h>
49   extern time_t   time();
50   static time_t   tmodesw;
51   static time_t   timm, tadd;
# Line 155 | Line 160 | disp_wait()                    /* wait for more input */
160          int     n;
161          register int    i;
162                                  /* see if we can avoid select call */
163 +        if (hdlist[0] == NULL)
164 +                return(RDY_SRV);        /* initialize first */
165          flgs = 0;               /* flag what's ready already */
166 <        if (imm_mode || stdin->_cnt > 0)
166 >        if (imm_mode || fbufcnt(stdin) > 0)
167                  flgs |= RDY_SRV;
168 <        if (sstdin != NULL && sstdin->_cnt > 0)
168 >        if (sstdin != NULL && fbufcnt(sstdin) > 0)
169                  flgs |= RDY_SIN;
170          if (odev.inpready)
171                  flgs |= RDY_DEV;
# Line 269 | Line 276 | register VIEW  *v;
276          static VIEW     viewhist[VIEWHISTLEN];
277          static unsigned nhist;
278          VIEW    *dv;
279 <        int     i, res[2], *slist;
279 >        int     i, res[2];
280 >        int2    *slist;
281          char    *err;
282                                  /* restore previous view? */
283          if (v == NULL) {
# Line 502 | Line 510 | serv_result()                  /* get next server result and process
510                  break;
511          case DS_STARTIMM:
512          case DS_ENDIMM:
513 +                if (!(imm_mode = msg.type==DS_STARTIMM))
514 +                        dev_flush();
515   #ifdef DEBUG
516                  {
517                          time_t  tnow = time(NULL);
# Line 510 | Line 520 | serv_result()                  /* get next server result and process
520                          tmodesw = tnow;
521                  }
522   #endif
513                if (!(imm_mode = msg.type==DS_STARTIMM))
514                        dev_flush();
523                  goto noargs;
524          case DS_ACKNOW:
525          case DS_SHUTDOWN:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines