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.50 by schorsch, Thu Jan 1 11:21:55 2004 UTC vs.
Revision 3.54 by greg, Thu Aug 18 00:52:48 2016 UTC

# Line 325 | Line 325 | again:
325                                  return;
326                          }
327                          *v = *(viewhist + ((nhist-1)%VIEWHISTLEN));
328 <                        goto again;     /* poss. overloading dev_section()? */
328 >                        goto again;     /* XXX overloading dev_section()? */
329                  }
330                  DCHECK(*slist < 0, WARNING, "no visible sections in new_view");
331                  for ( ; *slist >= 0; slist++)
# Line 382 | Line 382 | set_focus(                     /* set focus frame */
382                  vwfocus.horiz = hsiz * odev.v.horiz;
383                  vwfocus.vert = vsiz * odev.v.vert;
384                  break;
385 +        case VT_PLS:
386 +                vwfocus.horiz = hsiz * sin((PI/180./2.)*odev.v.horiz) /
387 +                                (1.0 + cos((PI/180./2.)*odev.v.horiz));
388 +                vwfocus.horiz *= vwfocus.horiz;
389 +                vwfocus.horiz = (2.*180./PI)*acos((1. - vwfocus.horiz) /
390 +                                                (1. + vwfocus.horiz));
391 +                vwfocus.vert = vsiz * sin((PI/180./2.)*odev.v.vert) /
392 +                                (1.0 + cos((PI/180./2.)*odev.v.vert));
393 +                vwfocus.vert *= vwfocus.vert;
394 +                vwfocus.vert = (2.*180./PI)*acos((1. - vwfocus.vert) /
395 +                                                (1. + vwfocus.vert));
396 +                break;
397          case VT_HEM:
398                  vwfocus.horiz = 2.*180./PI*asin(
399                                  hsiz * sin(PI/180./2.*odev.v.horiz) );
# Line 494 | Line 506 | serv_result(void)                      /* get next server result and proc
506          static int      bufsiz = 0;
507          MSGHEAD msg;
508                                          /* read message header */
509 <        if (fread((char *)&msg, sizeof(MSGHEAD), 1, stdin) != 1)
509 >        if (getbinary(&msg, sizeof(MSGHEAD), 1, stdin) != 1)
510                  goto readerr;
511          if (msg.nbytes > 0) {           /* get the message body */
512                  if (msg.nbytes > bufsiz) {
# Line 506 | Line 518 | serv_result(void)                      /* get next server result and proc
518                          if (buf == NULL)
519                                  error(SYSTEM, "out of memory in serv_result");
520                  }
521 <                if (fread(buf, 1, msg.nbytes, stdin) != msg.nbytes)
521 >                if (getbinary(buf, 1, msg.nbytes, stdin) != msg.nbytes)
522                          goto readerr;
523          }
524          switch (msg.type) {             /* process results */
# Line 531 | Line 543 | serv_result(void)                      /* get next server result and proc
543                  break;
544          case DS_STARTIMM:
545          case DS_ENDIMM:
546 <                if (!(imm_mode = msg.type==DS_STARTIMM))
546 >                if (!(imm_mode = (msg.type==DS_STARTIMM)))
547                          dev_flush();
548   #ifdef DEBUG
549                  {
# Line 585 | Line 597 | serv_request(  /* send a request to the server process
597          }
598          msg.type = type;        /* write and flush the message */
599          msg.nbytes = nbytes;
600 <        fwrite((char *)&msg, sizeof(MSGHEAD), 1, stdout);
600 >        putbinary(&msg, sizeof(MSGHEAD), 1, stdout);
601          if (nbytes > 0)
602 <                fwrite(p, 1, nbytes, stdout);
602 >                putbinary(p, 1, nbytes, stdout);
603          if (fflush(stdout) < 0)
604                  error(SYSTEM, "write error in serv_request");
605   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines