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

Comparing ray/src/rt/source.c (file contents):
Revision 2.69 by greg, Wed Nov 7 18:22:29 2018 UTC vs.
Revision 2.70 by greg, Thu Nov 8 00:54:07 2018 UTC

# Line 9 | Line 9 | static const char RCSid[] = "$Id$";
9  
10   #include  "ray.h"
11   #include  "otypes.h"
12 + #include  "otspecial.h"
13   #include  "rtotypes.h"
14   #include  "source.h"
15   #include  "random.h"
# Line 40 | Line 41 | static CNTPTR  *cntord;                        /* source ordering in direct
41   static int  maxcntr = 0;                /* size of contribution arrays */
42  
43   static int cntcmp(const void *p1, const void *p2);
43
44
45 OBJREC *                        /* find an object's actual material */
46 findmaterial(OBJREC *o)
47 {
48        while (!ismaterial(o->otype)) {
49                if (o->otype == MOD_ALIAS && o->oargs.nsargs) {
50                        OBJECT  aobj;
51                        OBJREC  *ao;
52                        aobj = lastmod(objndx(o), o->oargs.sarg[0]);
53                        if (aobj < 0)
54                                objerror(o, USER, "bad reference");
55                                /* recursive check on alias branch */
56                        if ((ao = findmaterial(objptr(aobj))) != NULL)
57                                return(ao);
58                }
59                if (o->omod == OVOID)
60                        return(NULL);
61                o = objptr(o->omod);
62        }
63        return(o);              /* mixtures will return NULL */
64 }
44  
45  
46   void

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines