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 1.35 by greg, Thu Jun 20 13:43:29 1991 UTC vs.
Revision 1.36 by greg, Thu Jun 20 16:36:41 1991 UTC

# Line 43 | Line 43 | marksources()                  /* find and mark source objects */
43   {
44          int  i;
45          register OBJREC  *o, *m;
46 <        register SRCREC  *ns;
46 >        register int  ns;
47                                          /* initialize dispatch table */
48          initstypes();
49                                          /* find direct sources */
# Line 72 | Line 72 | marksources()                  /* find and mark source objects */
72                                  sfun[o->otype].of->setsrc == NULL)
73                          objerror(o, USER, "illegal material");
74  
75 <                if ((ns = newsource()) == NULL)
75 >                if ((ns = newsource()) < 0)
76                          goto memerr;
77  
78 <                (*sfun[o->otype].of->setsrc)(ns, o);
78 >                (*sfun[o->otype].of->setsrc)(&source[ns], o);
79  
80                  if (m->otype == MAT_GLOW) {
81 <                        ns->sflags |= SPROX;
82 <                        ns->sl.prox = m->oargs.farg[3];
81 >                        source[ns].sflags |= SPROX;
82 >                        source[ns].sl.prox = m->oargs.farg[3];
83                          if (o->otype == OBJ_SOURCE)
84 <                                ns->sflags |= SSKIP;
84 >                                source[ns].sflags |= SSKIP;
85                  } else if (m->otype == MAT_SPOT) {
86 <                        ns->sflags |= SSPOT;
87 <                        if ((ns->sl.s = makespot(m)) == NULL)
86 >                        source[ns].sflags |= SSPOT;
87 >                        if ((source[ns].sl.s = makespot(m)) == NULL)
88                                  goto memerr;
89                  }
90          }
# Line 95 | Line 95 | marksources()                  /* find and mark source objects */
95          markvirtuals();                 /* find and add virtual sources */
96          srccnt = (CONTRIB *)malloc(nsources*sizeof(CONTRIB));
97          cntord = (CNTPTR *)malloc(nsources*sizeof(CNTPTR));
98 <        if (srccnt != NULL && cntord != NULL)
98 >        if (srccnt == NULL || cntord == NULL)
99                  goto memerr;
100          return;
101   memerr:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines