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.18 by schorsch, Fri Jan 2 12:51:54 2004 UTC vs.
Revision 3.23 by greg, Mon Mar 21 19:06:08 2016 UTC

# Line 203 | Line 203 | userr:
203  
204  
205   void
206 < quit(code)                              /* exit gracefully */
207 < int     code;
206 > quit(                           /* exit gracefully */
207 >        int     code
208 > )
209   {
210          if (ourdisplay != NULL)
211                  dev_close();
# Line 280 | Line 281 | runrad(                                /* run rad and load variables */
281                  eyedist = atof(cp);
282                                                  /* look for materials */
283          while ((cp = scan4var(buf, sizeof(buf), "materials", fp)) != NULL) {
284 <                nscenef += wordstring(scene+nscenef, cp);
284 >                nscenef += wordstring(scene+nscenef, MAXSCENE-nscenef, cp);
285                  buf[0] = '\0';
286          }
287                                                  /* look for octree */
# Line 288 | Line 289 | runrad(                                /* run rad and load variables */
289                  octree = savqstr(cp);
290                                                  /* look for scene files */
291          while ((cp = scan4var(buf, sizeof(buf), "scene", fp)) != NULL) {
292 <                nscenef += wordstring(scene+nscenef, cp);
292 >                nscenef += wordstring(scene+nscenef, MAXSCENE-nscenef, cp);
293                  buf[0] = '\0';
294          }
295                                                  /* load view names */
# Line 448 | Line 449 | dev_open(                      /* initialize GLX driver */
449                                          /* set window manager hints */
450          ourxwmhints.flags = InputHint|IconPixmapHint;
451          ourxwmhints.input = True;
452 <        ourxwmhints.icon_pixmap = XCreateBitmapFromData(ourdisplay,
453 <                gwind, glradicon_bits, glradicon_width, glradicon_height);
452 >        ourxwmhints.icon_pixmap = XCreateBitmapFromData(ourdisplay, gwind,
453 >                (char *)glradicon_bits, glradicon_width, glradicon_height);
454          XSetWMHints(ourdisplay, gwind, &ourxwmhints);
455                                          /* set GLX context */
456          glXMakeCurrent(ourdisplay, gwind, gctx);
# Line 645 | Line 646 | moveview(      /* move our view */
646                  VSUM(nv.vp, wp, odir, -1.);
647                  spinvector(nv.vdir, nv.vdir, nv.vup, d);
648          } else if (orb) {               /* orbit up/down */
649 <                fcross(v1, odir, nv.vup);
650 <                if (normalize(v1) == 0.)
649 >                if (geodesic(odir, odir, nv.vup,
650 >                                d=MOVDEG*PI/180.*orb, GEOD_RAD) == 0.0)
651                          return(0);
651                spinvector(odir, odir, v1, d=MOVDEG*PI/180.*orb);
652                  VSUM(nv.vp, wp, odir, -1.);
653 <                spinvector(nv.vdir, nv.vdir, v1, d);
653 >                geodesic(nv.vdir, nv.vdir, nv.vup, d, GEOD_RAD);
654          } else if (mov) {               /* move forward/backward */
655                  d = MOVPCT/100. * mov;
656                  VSUM(nv.vp, nv.vp, odir, d);
# Line 672 | Line 672 | waitabit(void)                         /* pause a moment */
672   {
673          struct timespec ts;
674          ts.tv_sec = 0;
675 <        ts.tv_nsec = 5000000;
675 >        ts.tv_nsec = 50000000;
676          nanosleep(&ts, NULL);
677   }
678  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines