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

Comparing ray/src/hd/rhd_glx1.c (file contents):
Revision 3.4 by schorsch, Sun Mar 28 20:33:13 2004 UTC vs.
Revision 3.9 by greg, Thu Apr 28 16:28:20 2016 UTC

# Line 61 | Line 61 | static const char      RCSid[] = "$Id$";
61  
62   struct driver   odev;                   /* global device driver structure */
63  
64 + TMstruct        *tmGlobal;              /* global tone-mapping structure */
65 +
66   char odev_args[64];                     /* command arguments */
67  
68   static XEvent  currentevent;            /* current event */
# Line 142 | Line 144 | dev_open(
144                                  &myprims[BLU][CIEX],&myprims[BLU][CIEY],
145                                  &myprims[WHT][CIEX],&myprims[WHT][CIEY]) >= 6)
146                  dpri = myprims;
147 <        if (tmInit(mytmflags(), dpri, gamval) == NULL)
147 >        tmGlobal = tmInit(mytmflags(), dpri, gamval);
148 >        if (tmGlobal == NULL)
149                  error(SYSTEM, "not enough memory in dev_open");
150                                          /* open window */
151          ourwinattr.background_pixel = ourblack;
# Line 211 | Line 214 | dev_close(void)                        /* close our display and free resour
214          XCloseDisplay(ourdisplay);
215          ourdisplay = NULL;
216          qtFreeLeaves();
217 <        tmDone(NULL);
217 >        tmDone(tmGlobal);
218          freecones();
219          odev.v.type = 0;
220          odev.hres = odev.vres = 0;
# Line 283 | Line 286 | dev_view(                      /* assign new driver view */
286  
287   extern void
288   dev_section(            /* add octree for geometry rendering */
289 <        char    *ofn
289 >        char    *gfn,
290 >        char    *pfn
291   )
292   {
293          /* unimplemented */
# Line 340 | Line 344 | dev_flush(void)                        /* flush output */
344  
345   extern void
346   dev_cone(               /* render a cone in view coordinates */
347 <        BYTE    rgb[3],
347 >        uby8    rgb[3],
348          FVECT   ip,
349          double  rad
350   )
# Line 461 | Line 465 | getevent(void)                 /* get next event */
465                  getkey(levptr(XKeyPressedEvent));
466                  break;
467          case ButtonPress:
468 <                getmove(levptr(XButtonPressedEvent));
468 >                switch (levptr(XButtonPressedEvent)->button) {
469 >                case Button4:           /* wheel up */
470 >                case Button5:           /* wheel down */
471 >                        break;
472 >                default:
473 >                        getmove(levptr(XButtonPressedEvent));
474 >                        break;
475 >                }
476                  break;
477          }
478   }
# Line 480 | Line 491 | draw3dline(                    /* draw 3d line in world coordinates */
491   static void
492   draw_grids(void)                        /* draw holodeck section grids */
493   {
494 <        static BYTE     gridrgba[4] = {0x0, 0xff, 0xff, 0x00};
494 >        static uby8     gridrgba[4] = {0x0, 0xff, 0xff, 0x00};
495          double  xmin, xmax, ymin, ymax, zmin, zmax;
496          double  d;
497                                          /* can we even do it? */
# Line 552 | Line 563 | moveview(      /* move our view */
563                  VSUM(nv.vp, qtL.wp[li], odir, -1.);
564                  spinvector(nv.vdir, nv.vdir, nv.vup, d);
565          } else if (orb) {               /* orbit up/down */
566 <                fcross(v1, odir, nv.vup);
567 <                if (normalize(v1) == 0.)
566 >                if (geodesic(odir, odir, nv.vup,
567 >                                d=MOVDEG*PI/180.*orb, GEOD_RAD) == 0.0)
568                          return(0);
558                spinvector(odir, odir, v1, d=MOVDEG*PI/180.*orb);
569                  VSUM(nv.vp, qtL.wp[li], odir, -1.);
570 <                spinvector(nv.vdir, nv.vdir, v1, d);
570 >                geodesic(nv.vdir, nv.vdir, nv.vup, d, GEOD_RAD);
571          } else if (mov) {               /* move forward/backward */
572                  d = MOVPCT/100. * mov;
573                  VSUM(nv.vp, nv.vp, odir, d);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines