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

Comparing ray/src/common/lamps.c (file contents):
Revision 2.2 by greg, Tue Nov 10 10:29:22 1992 UTC vs.
Revision 2.3 by greg, Mon Aug 23 10:12:43 1993 UTC

# Line 92 | Line 92 | char   *file;
92                                  goto fmterr;
93                          }
94                  } else {                        /* or read specificaion */
95 <                        if ((lp->color=(float *)malloc(3*sizeof(float)))==NULL)
95 >                        if ((lp->color=(float *)malloc(6*sizeof(float)))==NULL)
96                                  goto memerr;
97 <                        if (sscanf(cp1, "%f %f %f", &lp->color[0], &
98 <                                        lp->color[1], &lp->color[2]) != 3) {
97 >                        if (sscanf(cp1, "%f %f %f", &lp->color[3], &
98 >                                        lp->color[4], &lp->color[5]) != 3) {
99                                  cp1 = "bad lamp data";
100                                  goto fmterr;
101                          }
102                                                  /* convert xyY to XYZ */
103 <                        xyz[1] = lp->color[2];
104 <                        xyz[0] = lp->color[0]/lp->color[1] * xyz[1];
105 <                        xyz[2] = xyz[1]*(1./lp->color[1] - 1.) - xyz[0];
103 >                        xyz[1] = lp->color[5];
104 >                        xyz[0] = lp->color[3]/lp->color[4] * xyz[1];
105 >                        xyz[2] = xyz[1]*(1./lp->color[4] - 1.) - xyz[0];
106                                                  /* XYZ to RGB */
107                          cie_rgb(lp->color, xyz);
108                  }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines