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

Comparing ray/src/gen/mkillum2.c (file contents):
Revision 2.6 by greg, Fri Jan 7 14:51:46 1994 UTC vs.
Revision 2.10 by schorsch, Thu Jun 26 00:58:09 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1991 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Routines to do the actual calculation for mkillum
6   */
7  
8   #include  "mkillum.h"
12
9   #include  "face.h"
14
10   #include  "cone.h"
16
11   #include  "random.h"
12  
13  
# Line 118 | Line 112 | char  *nm;
112                          objerror(ob, WARNING, "bad aspect");
113                          rt->nrays = 0;
114                          freeface(ob);
115 <                        free((char *)distarr);
115 >                        free((void *)distarr);
116                          o_default(ob, il, rt, nm);
117                          return;
118                      }
# Line 137 | Line 131 | char  *nm;
131                  printobj(il->altmat, ob);
132                                  /* clean up */
133          freeface(ob);
134 <        free((char *)distarr);
134 >        free((void *)distarr);
135   #undef MAXMISS
136   }
137  
# Line 163 | Line 157 | char  *nm;
157                  nalt = nazi = 1;
158          else {
159                  n = 4.*PI * il->sampdens;
160 <                nalt = sqrt(n/PI) + .5;
161 <                nazi = PI*nalt + .5;
160 >                nalt = sqrt(2./PI*n) + .5;
161 >                nazi = PI/2.*nalt + .5;
162          }
163          n = nalt*nazi;
164          distarr = (float *)calloc(n, 3*sizeof(float));
# Line 207 | Line 201 | char  *nm;
201          } else
202                  printobj(il->altmat, ob);
203                                  /* clean up */
204 <        free((char *)distarr);
204 >        free((void *)distarr);
205   }
206  
207  
# Line 276 | Line 270 | char  *nm;
270                  printobj(il->altmat, ob);
271                                  /* clean up */
272          freecone(ob);
273 <        free((char *)distarr);
273 >        free((void *)distarr);
274   }
275  
276  
# Line 305 | Line 299 | register struct rtproc  *rt;
299                  return;
300          bzero(rt->buf+6*rt->nrays, 6*sizeof(float));
301          errno = 0;
302 <        if ( process(rt->pd, (char *)rt->buf, (char *)rt->buf,
303 <                        3*sizeof(float)*rt->nrays,
302 >        if ( process(&(rt->pd), (char *)rt->buf, (char *)rt->buf,
303 >                        3*sizeof(float)*(rt->nrays+1),
304                          6*sizeof(float)*(rt->nrays+1)) <
305 <                        3*sizeof(float)*rt->nrays )
305 >                        3*sizeof(float)*(rt->nrays+1) )
306                  error(SYSTEM, "error reading from rtrace process");
307          i = rt->nrays;
308          while (i--) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines