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

Comparing ray/src/rt/rv3.c (file contents):
Revision 1.5 by greg, Tue Jun 13 08:17:24 1989 UTC vs.
Revision 1.6 by greg, Mon Jun 19 13:30:04 1989 UTC

# Line 68 | Line 68 | newimage()                             /* start a new image */
68          freepkids(&ptrunk);
69                                                  /* set up frame */
70          if (ourview.hresolu > dev->xsiz || ourview.vresolu > dev->ysiz)
71 <                error(USER, "resolution mismatch");
71 >                newview(&ourview);              /* beware recursive loop! */
72          pframe.l = pframe.d = 0;
73          pframe.r = ourview.hresolu; pframe.u = ourview.vresolu;
74          pdepth = 0;
# Line 247 | Line 247 | register VIEW  *vp;
247   {
248          char  *err;
249  
250 <        if (vp->hresolu > dev->xsiz || vp->vresolu > dev->ysiz) {
251 <                error(COMMAND, "view not set - resolution mismatch");
252 <        } else if ((err = setview(vp)) != NULL) {
250 >        if (vp->hresolu > dev->xsiz || vp->vresolu > dev->ysiz) /* shrink */
251 >                if (vp->vresolu * dev->xsiz < vp->hresolu * dev->ysiz) {
252 >                        vp->vresolu = dev->xsiz * vp->vresolu / vp->hresolu;
253 >                        vp->hresolu = dev->xsiz;
254 >                } else {
255 >                        vp->hresolu = dev->ysiz * vp->hresolu / vp->vresolu;
256 >                        vp->vresolu = dev->ysiz;
257 >                }
258 >        if ((err = setview(vp)) != NULL) {
259                  sprintf(errmsg, "view not set - %s", err);
260                  error(COMMAND, errmsg);
261          } else if (bcmp(vp, &ourview, sizeof(VIEW))) {
262                  bcopy(&ourview, &oldview, sizeof(VIEW));
263                  bcopy(vp, &ourview, sizeof(VIEW));
264 <                newimage();
264 >                newimage();             /* newimage() calls with vp=&ourview! */
265          }
266   }
267  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines