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

Comparing ray/src/rt/raytrace.c (file contents):
Revision 2.13 by greg, Mon Jan 24 11:51:31 1994 UTC vs.
Revision 2.52 by greg, Tue Jun 21 15:06:50 2005 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1994 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   *  raytrace.c - routines for tracing and shading rays.
6   *
7 < *     8/7/85
7 > *  External symbols declared in ray.h
8   */
9  
10 < #include  "ray.h"
10 > #include "copyright.h"
11  
12 < #include  "octree.h"
13 <
12 > #include  "ray.h"
13 > #include  "source.h"
14   #include  "otypes.h"
18
15   #include  "otspecial.h"
16 + #include  "random.h"
17  
18   #define  MAXCSET        ((MAXSET+1)*2-1)        /* maximum check set size */
19  
23 extern CUBE  thescene;                  /* our scene */
24 extern int  maxdepth;                   /* maximum recursion depth */
25 extern double  minweight;               /* minimum ray weight */
26 extern int  do_irrad;                   /* compute irradiance? */
27
20   unsigned long  raynum = 0;              /* next unique ray number */
21   unsigned long  nrays = 0;               /* number of calls to localhit */
22  
23 < static FLOAT  Lambfa[5] = {PI, PI, PI, 0.0, 0.0};
23 > static RREAL  Lambfa[5] = {PI, PI, PI, 0.0, 0.0};
24   OBJREC  Lamb = {
25          OVOID, MAT_PLASTIC, "Lambertian",
26          {0, 5, NULL, Lambfa}, NULL,
27   };                                      /* a Lambertian surface */
28  
29 < static int  raymove(), checkset(), checkhit();
29 > OBJREC  Aftplane;                       /* aft clipping plane object */
30  
39 #define  MAXLOOP        128             /* modifier loop detection */
40
31   #define  RAYHIT         (-1)            /* return value for intercepted ray */
32  
33 + static int raymove(FVECT  pos, OBJECT  *cxs, int  dirf, RAY  *r, CUBE  *cu);
34 + static int checkhit(RAY  *r, CUBE  *cu, OBJECT  *cxs);
35 + static void checkset(OBJECT  *os, OBJECT  *cs);
36  
37 < rayorigin(r, ro, rt, rw)                /* start new ray from old one */
38 < register RAY  *r, *ro;
39 < int  rt;
40 < double  rw;
37 >
38 > extern int
39 > rayorigin(              /* start new ray from old one */
40 >        RAY  *r,
41 >        int  rt,
42 >        const RAY  *ro,
43 >        const COLOR rc
44 > )
45   {
46 +        double  rw, re;
47 +                                                /* assign coefficient/weight */
48 +        if (rc == NULL) {
49 +                rw = 1.0;
50 +                setcolor(r->rcoef, 1., 1., 1.);
51 +        } else {
52 +                rw = intens(rc);
53 +                if (rc != r->rcoef)
54 +                        copycolor(r->rcoef, rc);
55 +        }
56          if ((r->parent = ro) == NULL) {         /* primary ray */
57                  r->rlvl = 0;
58                  r->rweight = rw;
# Line 53 | Line 60 | double  rw;
60                  r->rsrc = -1;
61                  r->clipset = NULL;
62                  r->revf = raytrace;
63 +                copycolor(r->cext, cextinction);
64 +                copycolor(r->albedo, salbedo);
65 +                r->gecc = seccg;
66 +                r->slights = NULL;
67          } else {                                /* spawned ray */
68 +                if (ro->rot >= FHUGE) {
69 +                        memset(r, 0, sizeof(RAY));
70 +                        return(-1);             /* illegal continuation */
71 +                }
72                  r->rlvl = ro->rlvl;
73                  if (rt & RAYREFL) {
74                          r->rlvl++;
75                          r->rsrc = -1;
76                          r->clipset = ro->clipset;
77 +                        r->rmax = 0.0;
78                  } else {
79                          r->rsrc = ro->rsrc;
80                          r->clipset = ro->newcset;
81 +                        r->rmax = ro->rmax <= FTINY ? 0.0 : ro->rmax - ro->rot;
82                  }
83                  r->revf = ro->revf;
84 <                r->rweight = ro->rweight * rw;
84 >                copycolor(r->cext, ro->cext);
85 >                copycolor(r->albedo, ro->albedo);
86 >                r->gecc = ro->gecc;
87 >                r->slights = ro->slights;
88                  r->crtype = ro->crtype | (r->rtype = rt);
89                  VCOPY(r->rorg, ro->rop);
90 +                r->rweight = ro->rweight * rw;
91 +                                                /* estimate extinction */
92 +                re = colval(ro->cext,RED) < colval(ro->cext,GRN) ?
93 +                                colval(ro->cext,RED) : colval(ro->cext,GRN);
94 +                if (colval(ro->cext,BLU) < re) re = colval(ro->cext,BLU);
95 +                re *= ro->rot;
96 +                if (re > .1)
97 +                        r->rweight *= exp(-re);
98          }
99          rayclear(r);
100 +        if (r->crtype & SHADOW)                 /* shadow commitment */
101 +                return(0);
102 +        if (maxdepth <= 0 && rc != NULL) {      /* Russian roulette */
103 +                if (minweight <= 0.0)
104 +                        error(USER, "zero ray weight in Russian roulette");
105 +                if (maxdepth < 0 && r->rlvl > -maxdepth)
106 +                        return(-1);             /* upper reflection limit */
107 +                if (r->rweight >= minweight)
108 +                        return(0);
109 +                if (frandom() < r->rweight/minweight)
110 +                        return(-1);
111 +                rw = minweight/r->rweight;      /* promote survivor */
112 +                scalecolor(r->rcoef, rw);
113 +                r->rweight = minweight;
114 +                return(0);
115 +        }
116          return(r->rlvl <= maxdepth && r->rweight >= minweight ? 0 : -1);
117   }
118  
119  
120 < rayclear(r)                     /* clear a ray for (re)evaluation */
121 < register RAY  *r;
120 > extern void
121 > rayclear(                       /* clear a ray for (re)evaluation */
122 >        register RAY  *r
123 > )
124   {
125          r->rno = raynum++;
126          r->newcset = r->clipset;
127 +        r->hitf = rayhit;
128 +        r->robj = OVOID;
129          r->ro = NULL;
130 <        r->rot = FHUGE;
130 >        r->rox = NULL;
131 >        r->rt = r->rot = FHUGE;
132          r->pert[0] = r->pert[1] = r->pert[2] = 0.0;
133 +        r->uv[0] = r->uv[1] = 0.0;
134          setcolor(r->pcol, 1.0, 1.0, 1.0);
135          setcolor(r->rcol, 0.0, 0.0, 0.0);
86        r->rt = 0.0;
136   }
137  
138  
139 < raytrace(r)                     /* trace a ray and compute its value */
140 < RAY  *r;
139 > extern void
140 > raytrace(                       /* trace a ray and compute its value */
141 >        RAY  *r
142 > )
143   {
93        extern int  (*trace)();
94        int  gotmat;
95
144          if (localhit(r, &thescene))
145 <                gotmat = raycont(r);
146 <        else if (sourcehit(r))
147 <                gotmat = rayshade(r, r->ro->omod);
145 >                raycont(r);             /* hit local surface, evaluate */
146 >        else if (r->ro == &Aftplane) {
147 >                r->ro = NULL;           /* hit aft clipping plane */
148 >                r->rot = FHUGE;
149 >        } else if (sourcehit(r))
150 >                rayshade(r, r->ro->omod);       /* distant source */
151  
101        if (!gotmat)
102                objerror(r->ro, USER, "material not found");
103
152          if (trace != NULL)
153                  (*trace)(r);            /* trace execution */
154 +
155 +        rayparticipate(r);              /* for participating medium */
156   }
157  
158  
159 < raycont(r)                      /* check for clipped object and continue */
160 < register RAY  *r;
159 > extern void
160 > raycont(                        /* check for clipped object and continue */
161 >        register RAY  *r
162 > )
163   {
164          if ((r->clipset != NULL && inset(r->clipset, r->ro->omod)) ||
165 <                        r->ro->omod == OVOID) {
165 >                        !rayshade(r, r->ro->omod))
166                  raytrans(r);
115                return(1);
116        }
117        return(rayshade(r, r->ro->omod));
167   }
168  
169  
170 < raytrans(r)                     /* transmit ray as is */
171 < register RAY  *r;
170 > extern void
171 > raytrans(                       /* transmit ray as is */
172 >        register RAY  *r
173 > )
174   {
175          RAY  tr;
176  
177 <        if (rayorigin(&tr, r, TRANS, 1.0) == 0) {
177 >        if (rayorigin(&tr, TRANS, r, NULL) == 0) {
178                  VCOPY(tr.rdir, r->rdir);
179                  rayvalue(&tr);
180                  copycolor(r->rcol, tr.rcol);
# Line 132 | Line 183 | register RAY  *r;
183   }
184  
185  
186 < rayshade(r, mod)                /* shade ray r with material mod */
187 < register RAY  *r;
188 < int  mod;
186 > extern int
187 > rayshade(               /* shade ray r with material mod */
188 >        register RAY  *r,
189 >        int  mod
190 > )
191   {
139        static int  depth = 0;
140        int  gotmat;
192          register OBJREC  *m;
193 <                                        /* check for infinite loop */
143 <        if (depth++ >= MAXLOOP)
144 <                objerror(r->ro, USER, "possible modifier loop");
193 >
194          r->rt = r->rot;                 /* set effective ray length */
195 <        for (gotmat = 0; !gotmat && mod != OVOID; mod = m->omod) {
195 >        for ( ; mod != OVOID; mod = m->omod) {
196                  m = objptr(mod);
197                  /****** unnecessary test since modifier() is always called
198                  if (!ismodifier(m->otype)) {
# Line 152 | Line 201 | int  mod;
201                  }
202                  ******/
203                                          /* hack for irradiance calculation */
204 <                if (do_irrad && !(r->crtype & ~(PRIMARY|TRANS))) {
204 >                if (do_irrad && !(r->crtype & ~(PRIMARY|TRANS)) &&
205 >                                m->otype != MAT_CLIP &&
206 >                                (ofun[m->otype].flags & (T_M|T_X))) {
207                          if (irr_ignore(m->otype)) {
157                                depth--;
208                                  raytrans(r);
209 <                                return;
209 >                                return(1);
210                          }
211                          if (!islight(m->otype))
212                                  m = &Lamb;
213                  }
214 <                                        /* materials call raytexture */
215 <                gotmat = (*ofun[m->otype].funp)(m, r);
214 >                if ((*ofun[m->otype].funp)(m, r))
215 >                        return(1);      /* materials call raytexture() */
216          }
217 <        depth--;
168 <        return(gotmat);
217 >        return(0);                      /* no material! */
218   }
219  
220  
221 < raytexture(r, mod)                      /* get material modifiers */
222 < RAY  *r;
223 < int  mod;
221 > extern void
222 > rayparticipate(                 /* compute ray medium participation */
223 >        register RAY  *r
224 > )
225   {
226 <        static int  depth = 0;
226 >        COLOR   ce, ca;
227 >        double  re, ge, be;
228 >
229 >        if (intens(r->cext) <= 1./FHUGE)
230 >                return;                         /* no medium */
231 >        re = r->rot*colval(r->cext,RED);
232 >        ge = r->rot*colval(r->cext,GRN);
233 >        be = r->rot*colval(r->cext,BLU);
234 >        if (r->crtype & SHADOW) {               /* no scattering for sources */
235 >                re *= 1. - colval(r->albedo,RED);
236 >                ge *= 1. - colval(r->albedo,GRN);
237 >                be *= 1. - colval(r->albedo,BLU);
238 >        }
239 >        setcolor(ce,    re<=FTINY ? 1. : re>92. ? 0. : exp(-re),
240 >                        ge<=FTINY ? 1. : ge>92. ? 0. : exp(-ge),
241 >                        be<=FTINY ? 1. : be>92. ? 0. : exp(-be));
242 >        multcolor(r->rcol, ce);                 /* path extinction */
243 >        if (r->crtype & SHADOW || intens(r->albedo) <= FTINY)
244 >                return;                         /* no scattering */
245 >        setcolor(ca,
246 >                colval(r->albedo,RED)*colval(ambval,RED)*(1.-colval(ce,RED)),
247 >                colval(r->albedo,GRN)*colval(ambval,GRN)*(1.-colval(ce,GRN)),
248 >                colval(r->albedo,BLU)*colval(ambval,BLU)*(1.-colval(ce,BLU)));
249 >        addcolor(r->rcol, ca);                  /* ambient in scattering */
250 >        srcscatter(r);                          /* source in scattering */
251 > }
252 >
253 >
254 > extern void
255 > raytexture(                     /* get material modifiers */
256 >        RAY  *r,
257 >        OBJECT  mod
258 > )
259 > {
260          register OBJREC  *m;
178                                        /* check for infinite loop */
179        if (depth++ >= MAXLOOP)
180                objerror(r->ro, USER, "modifier loop");
261                                          /* execute textures and patterns */
262          for ( ; mod != OVOID; mod = m->omod) {
263                  m = objptr(mod);
# Line 187 | Line 267 | int  mod;
267                          error(USER, errmsg);
268                  }
269                  ******/
270 <                if ((*ofun[m->otype].funp)(m, r))
271 <                        objerror(r->ro, USER, "conflicting materials");
270 >                if ((*ofun[m->otype].funp)(m, r)) {
271 >                        sprintf(errmsg, "conflicting material \"%s\"",
272 >                                        m->oname);
273 >                        objerror(r->ro, USER, errmsg);
274 >                }
275          }
193        depth--;                        /* end here */
276   }
277  
278  
279 < raymixture(r, fore, back, coef)         /* mix modifiers */
280 < register RAY  *r;
281 < OBJECT  fore, back;
282 < double  coef;
279 > extern int
280 > raymixture(             /* mix modifiers */
281 >        register RAY  *r,
282 >        OBJECT  fore,
283 >        OBJECT  back,
284 >        double  coef
285 > )
286   {
287          RAY  fr, br;
288          int  foremat, backmat;
289          register int  i;
290 <                                        /* clip coefficient */
290 >                                        /* bound coefficient */
291          if (coef > 1.0)
292                  coef = 1.0;
293          else if (coef < 0.0)
294                  coef = 0.0;
295                                          /* compute foreground and background */
296 <        foremat = backmat = -1;
296 >        foremat = backmat = 0;
297                                          /* foreground */
298 <        copystruct(&fr, r);
299 <        if (fore != OVOID && coef > FTINY)
298 >        fr = *r;
299 >        if (coef > FTINY)
300                  foremat = rayshade(&fr, fore);
301                                          /* background */
302 <        copystruct(&br, r);
303 <        if (back != OVOID && coef < 1.0-FTINY)
302 >        br = *r;
303 >        if (coef < 1.0-FTINY)
304                  backmat = rayshade(&br, back);
305 <                                        /* check */
306 <        if (foremat < 0)
307 <                if (backmat < 0)
308 <                        foremat = backmat = 0;
309 <                else
310 <                        foremat = backmat;
311 <        else if (backmat < 0)
227 <                backmat = foremat;
228 <        if ((foremat==0) != (backmat==0))
229 <                objerror(r->ro, USER, "mixing material with non-material");
305 >                                        /* check for transparency */
306 >        if (backmat ^ foremat) {
307 >                if (backmat && coef > FTINY)
308 >                        raytrans(&fr);
309 >                else if (foremat && coef < 1.0-FTINY)
310 >                        raytrans(&br);
311 >        }
312                                          /* mix perturbations */
313          for (i = 0; i < 3; i++)
314                  r->pert[i] = coef*fr.pert[i] + (1.0-coef)*br.pert[i];
# Line 235 | Line 317 | double  coef;
317          scalecolor(br.pcol, 1.0-coef);
318          copycolor(r->pcol, fr.pcol);
319          addcolor(r->pcol, br.pcol);
320 +                                        /* return value tells if material */
321 +        if (!foremat & !backmat)
322 +                return(0);
323                                          /* mix returned ray values */
324 <        if (foremat) {
325 <                scalecolor(fr.rcol, coef);
326 <                scalecolor(br.rcol, 1.0-coef);
327 <                copycolor(r->rcol, fr.rcol);
328 <                addcolor(r->rcol, br.rcol);
329 <                r->rt = bright(fr.rcol) > bright(br.rcol) ? fr.rt : br.rt;
324 >        scalecolor(fr.rcol, coef);
325 >        scalecolor(br.rcol, 1.0-coef);
326 >        copycolor(r->rcol, fr.rcol);
327 >        addcolor(r->rcol, br.rcol);
328 >        r->rt = bright(fr.rcol) > bright(br.rcol) ? fr.rt : br.rt;
329 >        return(1);
330 > }
331 >
332 >
333 > extern double
334 > raydist(                /* compute (cumulative) ray distance */
335 >        register const RAY  *r,
336 >        register int  flags
337 > )
338 > {
339 >        double  sum = 0.0;
340 >
341 >        while (r != NULL && r->crtype&flags) {
342 >                sum += r->rot;
343 >                r = r->parent;
344          }
345 <                                        /* return value tells if material */
247 <        return(foremat);
345 >        return(sum);
346   }
347  
348  
349 < double
350 < raynormal(norm, r)              /* compute perturbed normal for ray */
351 < FVECT  norm;
352 < register RAY  *r;
349 > extern void
350 > raycontrib(             /* compute (cumulative) ray contribution */
351 >        double  rc[3],
352 >        const RAY  *r,
353 >        int  flags
354 > )
355   {
356 +        double  eext[3];
357 +        int     i;
358 +
359 +        eext[0] = eext[1] = eext[2] = 0.;
360 +        rc[0] = rc[1] = rc[2] = 1.;
361 +
362 +        while (r != NULL && r->crtype&flags) {
363 +                for (i = 3; i--; ) {
364 +                        rc[i] *= colval(r->rcoef,i);
365 +                        eext[i] += r->rot * colval(r->cext,i);
366 +                }
367 +                r = r->parent;
368 +        }
369 +        for (i = 3; i--; )
370 +                rc[i] *= (eext[i] <= FTINY) ? 1. :
371 +                                (eext[i] > 300.) ? 0. : exp(-eext[i]);
372 + }
373 +
374 +
375 + extern double
376 + raynormal(              /* compute perturbed normal for ray */
377 +        FVECT  norm,
378 +        register RAY  *r
379 + )
380 + {
381          double  newdot;
382          register int  i;
383  
# Line 283 | Line 408 | register RAY  *r;
408   }
409  
410  
411 < newrayxf(r)                     /* get new tranformation matrix for ray */
412 < RAY  *r;
411 > extern void
412 > newrayxf(                       /* get new tranformation matrix for ray */
413 >        RAY  *r
414 > )
415   {
416          static struct xfn {
417                  struct xfn  *next;
418                  FULLXF  xf;
419          }  xfseed = { &xfseed }, *xflast = &xfseed;
420          register struct xfn  *xp;
421 <        register RAY  *rp;
421 >        register const RAY  *rp;
422  
423          /*
424           * Search for transform in circular list that
# Line 302 | Line 429 | RAY  *r;
429                  if (rp->rox == &xp->xf) {               /* xp in use */
430                          xp = xp->next;                  /* move to next */
431                          if (xp == xflast) {             /* need new one */
432 <                                xp = (struct xfn *)bmalloc(sizeof(struct xfn));
432 >                                xp = (struct xfn *)malloc(sizeof(struct xfn));
433                                  if (xp == NULL)
434                                          error(SYSTEM,
435                                                  "out of memory in newrayxf");
# Line 319 | Line 446 | RAY  *r;
446   }
447  
448  
449 < flipsurface(r)                  /* reverse surface orientation */
450 < register RAY  *r;
449 > extern void
450 > flipsurface(                    /* reverse surface orientation */
451 >        register RAY  *r
452 > )
453   {
454          r->rod = -r->rod;
455          r->ron[0] = -r->ron[0];
# Line 332 | Line 461 | register RAY  *r;
461   }
462  
463  
464 < localhit(r, scene)              /* check for hit in the octree */
465 < register RAY  *r;
466 < register CUBE  *scene;
464 > extern void
465 > rayhit(                 /* standard ray hit test */
466 >        OBJECT  *oset,
467 >        RAY  *r
468 > )
469   {
470 +        OBJREC  *o;
471 +        int     i;
472 +
473 +        for (i = oset[0]; i > 0; i--) {
474 +                o = objptr(oset[i]);
475 +                if ((*ofun[o->otype].funp)(o, r))
476 +                        r->robj = oset[i];
477 +        }
478 + }
479 +
480 +
481 + extern int
482 + localhit(               /* check for hit in the octree */
483 +        register RAY  *r,
484 +        register CUBE  *scene
485 + )
486 + {
487          OBJECT  cxset[MAXCSET+1];       /* set of checked objects */
488          FVECT  curpos;                  /* current cube position */
489          int  sflags;                    /* sign flags */
# Line 353 | Line 501 | register CUBE  *scene;
501          }
502          if (sflags == 0)
503                  error(CONSISTENCY, "zero ray direction in localhit");
504 +                                        /* start off assuming nothing hit */
505 +        if (r->rmax > FTINY) {          /* except aft plane if one */
506 +                r->ro = &Aftplane;
507 +                r->rot = r->rmax;
508 +                for (i = 0; i < 3; i++)
509 +                        r->rop[i] = r->rorg[i] + r->rot*r->rdir[i];
510 +        }
511 +                                        /* find global cube entrance point */
512          t = 0.0;
513          if (!incube(scene, curpos)) {
514                                          /* find distance to entry */
# Line 370 | Line 526 | register CUBE  *scene;
526                                  t = dt; /* farthest face is the one */
527                  }
528                  t += FTINY;             /* fudge to get inside cube */
529 +                if (t >= r->rot)        /* clipped already */
530 +                        return(0);
531                                          /* advance position */
532                  for (i = 0; i < 3; i++)
533                          curpos[i] += r->rdir[i]*t;
# Line 378 | Line 536 | register CUBE  *scene;
536                          return(0);
537          }
538          cxset[0] = 0;
539 <        return(raymove(curpos, cxset, sflags, r, scene) == RAYHIT);
539 >        raymove(curpos, cxset, sflags, r, scene);
540 >        return((r->ro != NULL) & (r->ro != &Aftplane));
541   }
542  
543  
544   static int
545 < raymove(pos, cxs, dirf, r, cu)          /* check for hit as we move */
546 < FVECT  pos;                     /* current position, modified herein */
547 < OBJECT  *cxs;                   /* checked objects, modified by checkhit */
548 < int  dirf;                      /* direction indicators to speed tests */
549 < register RAY  *r;
550 < register CUBE  *cu;
545 > raymove(                /* check for hit as we move */
546 >        FVECT  pos,                     /* current position, modified herein */
547 >        OBJECT  *cxs,                   /* checked objects, modified by checkhit */
548 >        int  dirf,                      /* direction indicators to speed tests */
549 >        register RAY  *r,
550 >        register CUBE  *cu
551 > )
552   {
553          int  ax;
554          double  dt, t;
# Line 433 | Line 593 | register CUBE  *cu;
593                  }
594                  /*NOTREACHED*/
595          }
596 <        if (isfull(cu->cutree) && checkhit(r, cu, cxs))
596 >        if (isfull(cu->cutree)) {
597 >                if (checkhit(r, cu, cxs))
598 >                        return(RAYHIT);
599 >        } else if (r->ro == &Aftplane && incube(cu, r->rop))
600                  return(RAYHIT);
601                                          /* advance to next cube */
602          if (dirf&0x11) {
# Line 465 | Line 628 | register CUBE  *cu;
628   }
629  
630  
631 < static
632 < checkhit(r, cu, cxs)            /* check for hit in full cube */
633 < register RAY  *r;
634 < CUBE  *cu;
635 < OBJECT  *cxs;
631 > static int
632 > checkhit(               /* check for hit in full cube */
633 >        register RAY  *r,
634 >        CUBE  *cu,
635 >        OBJECT  *cxs
636 > )
637   {
638          OBJECT  oset[MAXSET+1];
475        register OBJREC  *o;
476        register int  i;
639  
640          objset(oset, cu->cutree);
641 <        checkset(oset, cxs);                    /* eliminate double-checking */
642 <        for (i = oset[0]; i > 0; i--) {
643 <                o = objptr(oset[i]);
644 <                (*ofun[o->otype].funp)(o, r);
645 <        }
484 <        if (r->ro == NULL)
641 >        checkset(oset, cxs);                    /* avoid double-checking */
642 >
643 >        (*r->hitf)(oset, r);                    /* test for hit in set */
644 >
645 >        if (r->robj == OVOID)
646                  return(0);                      /* no scores yet */
647  
648          return(incube(cu, r->rop));             /* hit OK if in current cube */
649   }
650  
651  
652 < static
653 < checkset(os, cs)                /* modify checked set and set to check */
654 < register OBJECT  *os;                   /* os' = os - cs */
655 < register OBJECT  *cs;                   /* cs' = cs + os */
652 > static void
653 > checkset(               /* modify checked set and set to check */
654 >        register OBJECT  *os,                   /* os' = os - cs */
655 >        register OBJECT  *cs                    /* cs' = cs + os */
656 > )
657   {
658          OBJECT  cset[MAXCSET+MAXSET+1];
659          register int  i, j;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines