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

Comparing ray/src/common/dircode.c (file contents):
Revision 2.2 by greg, Tue Mar 4 19:02:47 2003 UTC vs.
Revision 2.4 by schorsch, Sat Jun 7 12:50:20 2003 UTC

# Line 2 | Line 2
2   static const char RCSid[] = "$Id$";
3   #endif
4   /*
5 < * Compute 4-byte direction code (assume this fits into int)
5 > * Compute a 4-byte direction code (int4 type defined in standard.h).
6 > *
7 > * Mean accuracy is 0.0022 degrees, with a maximum error of 0.0058 degrees.
8   */
9  
10   #include "standard.h"
# Line 27 | Line 29 | FVECT  dv;
29  
30          for (i = 0; i < 3; i++)
31                  if (dv[i] < 0.) {
32 <                        cd[i] = dv[i] * -DCSCALE;
32 >                        cd[i] = (int)(dv[i] * -DCSCALE);
33                          dc |= FXNEG<<i;
34                  } else
35 <                        cd[i] = dv[i] * DCSCALE;
35 >                        cd[i] = (int)(dv[i] * DCSCALE);
36          if (cd[0] <= cd[1]) {
37                  dc |= F1X | cd[0] << F1SFT;
38                  cm = cd[1];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines