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.20 by gregl, Sun Jan 4 18:37:10 1998 UTC vs.
Revision 3.22 by gregl, Tue Jan 6 05:26:20 1998 UTC

# Line 30 | Line 30 | char   *progname;              /* global argv[0] */
30  
31   FILE    *sstdin, *sstdout;      /* server's standard input and output */
32  
33 + #ifdef DEBUG
34 + #include <sys/types.h>
35 + extern time_t   time();
36 + static time_t   tmodesw;
37 + static time_t   timm, tadd;
38 + static long     nimmrays, naddrays;
39 + #endif
40 +
41   #define RDY_SRV         01
42   #define RDY_DEV         02
43   #define RDY_SIN         04
# Line 55 | Line 63 | char   *argv[];
63                  sstdin = fdopen(inp, "r");
64                                          /* set command error vector */
65          erract[COMMAND].pf = eputs;
66 + #ifdef DEBUG
67 +        tmodesw = time(NULL);
68 + #endif
69                                          /* enter main loop */
70          do {
71                  rdy = disp_wait();
# Line 110 | Line 121 | char   *argv[];
121                                  break;
122                          }
123          } while (res != DS_SHUTDOWN);
124 + #ifdef DEBUG
125 +        if (timm && nimmrays)
126 +                fprintf(stderr,
127 +                        "%s: %.1f rays recalled/second (%ld rays total)\n",
128 +                                progname, (double)nimmrays/timm, nimmrays);
129 +        if (tadd && naddrays)
130 +                fprintf(stderr,
131 +                        "%s: %.1f rays calculated/second (%ld rays total)\n",
132 +                                progname, (double)naddrays/tadd, naddrays);
133 + #endif
134                                          /* all done */
135          quit(0);
136   }
# Line 212 | Line 233 | register PACKHEAD      *p;
233                  VSUM(wp, ro, rd, d);            /* might be behind viewpoint */
234                  dev_value(packra(p)[i].v, wp, rd);
235          }
236 + #ifdef DEBUG
237 +        if (imm_mode) nimmrays += p->nr;
238 +        else naddrays += p->nr;
239 + #endif
240   }
241  
242  
# Line 298 | Line 323 | usr_input()                    /* get user input and process it */
323                  break;
324          case DC_REDRAW:                 /* redraw from server */
325                  imm_mode = beam_sync() > 0;
326 +                dev_clear();
327                  break;
328          case DC_KILL:                   /* kill rtrace process(es) */
329                  serv_request(DR_KILL, 0, NULL);
# Line 366 | Line 392 | serv_result()                  /* get next server result and process
392                  break;
393          case DS_STARTIMM:
394          case DS_ENDIMM:
395 + #ifdef DEBUG
396 +                if (imm_mode != (msg.type==DS_STARTIMM)) {
397 +                        time_t  tnow = time(NULL);
398 +                        if (imm_mode) timm += tnow - tmodesw;
399 +                        else tadd += tnow - tmodesw;
400 +                        tmodesw = tnow;
401 +                }
402 + #endif
403                  imm_mode = msg.type==DS_STARTIMM;
404                  /* fall through */
405          case DS_ACKNOW:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines