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

Comparing ray/src/util/glrad.c (file contents):
Revision 3.1 by gwlarson, Tue Jun 9 11:43:18 1998 UTC vs.
Revision 3.2 by gwlarson, Tue Jun 9 12:46:45 1998 UTC

# Line 66 | Line 66 | struct {
66   int     currentview = 0;                /* current view number */
67   VIEW    thisview = STDVIEW;             /* displayed view */
68   VIEW    lastview;                       /* last recorded view */
69 char    *lastvc = NULL;                 /* cause of last view change */
69  
70   char    *progname;                      /* global argv[0] */
71   char    *radfile;                       /* rad input file */
# Line 80 | Line 79 | int    backvis = 1;                    /* back faces visible? */
79  
80   int     displist;                       /* our scene display list */
81  
82 + int     in_dev_view = 0;                /* currently in dev_view() */
83 +
84   extern char     *fgets(), *fgetline(), *atos(), *scan4var();
85   extern int      nowarn;                 /* turn warnings off? */
86   extern time_t   time();
# Line 419 | Line 420 | register VIEW  *nv;
420          }
421          if (hres != 0 & vres != 0) {
422                  wa = (vres*pheight)/(hres*pwidth);
423 <                va = viewaspect(&thisview);
423 >                va = viewaspect(nv);
424                  if (va > wa+.05) {
425                          newvres = (pwidth/pheight)*va*newhres + .5;
426                          if (newvres > maxvres) {
# Line 434 | Line 435 | register VIEW  *nv;
435                          }
436                  }
437                  if (newhres != hres | newvres != vres) {
438 +                        in_dev_view++;
439                          XResizeWindow(ourdisplay, gwind, newhres, newvres);
440                          do
441                                  dev_input(0);           /* get resize event */
442                          while (newhres != hres | newvres != vres);
443 +                        in_dev_view--;
444                  }
445          }
446          copystruct(&thisview, nv);
# Line 609 | Line 612 | register VIEW  *vp;
612   {
613          double  d, xmin, xmax, ymin, ymax, zmin, zmax;
614  
615 <        zmin = 0.05;
616 <        zmax = 5000.;
615 >        zmin = 0.1;
616 >        zmax = 1000.;
617          if (thisview.vfore > FTINY)
618                  zmin = thisview.vfore;
619          if (thisview.vaft > FTINY)
# Line 654 | Line 657 | register XKeyPressedEvent  *ekey;
657                  headlocked = 0;
658                  break;
659          case 'l':                       /* retrieve last (premouse) view */
660 <                if (lastvc != NULL) {
660 >                if (lastview.type) {
661                          VIEW    vtmp;
662                          copystruct(&vtmp, &thisview);
663                          dev_view(&lastview);
# Line 728 | Line 731 | int    vwnum;
731                  vwnum = 0;
732          if (vwnum == currentview)
733                  return;
734 +        /* copylastv("change view"); */
735          dev_view(vwl[currentview=vwnum].v);
736   }
737  
# Line 768 | Line 772 | VIEW   *vp;
772   copylastv(cause)                        /* copy last view position */
773   char    *cause;
774   {
775 +        static char     *lastvc;
776 +
777          if (cause == lastvc)
778                  return;                 /* only record one view per cause */
779          lastvc = cause;
# Line 798 | Line 804 | register XConfigureEvent  *ersz;
804          glViewport(0, 0, hres=ersz->width, vres=ersz->height);
805          if (hres > maxhres) maxhres = hres;
806          if (vres > maxvres) maxvres = vres;
807 +        if (in_dev_view)
808 +                return;
809          wa = (vres*pheight)/(hres*pwidth);
810          va = viewaspect(&thisview);
811          if (va > wa+.05) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines