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

Comparing ray/src/rt/preload.c (file contents):
Revision 2.13 by greg, Fri Nov 8 17:11:42 2013 UTC vs.
Revision 2.17 by greg, Thu Apr 4 18:51:18 2024 UTC

# Line 28 | Line 28 | load_os(                       /* load associated data for object */
28          OBJREC  *op
29   )
30   {
31 <        DATARRAY  *dp;
31 >        DATARRAY        *dp;
32 >        SDData          *sd;
33  
34 +        SDretainSet = SDretainAll;
35 +
36          switch (op->otype) {
37          case OBJ_FACE:          /* polygon */
38                  getface(op);
# Line 54 | Line 57 | load_os(                       /* load associated data for object */
57                  getfunc(op, 4, 0x3<<5, 0);
58                  return(1);
59          case PAT_CDATA:         /* color data */
60 +                if (op->oargs.nsargs < 4)
61 +                        goto sargerr;
62                  dp = getdata(op->oargs.sarg[3]);
63                  getdata(op->oargs.sarg[4]);
64                  getdata(op->oargs.sarg[5]);
# Line 71 | Line 76 | load_os(                       /* load associated data for object */
76          case PAT_CFUNC:         /* color function */
77                  getfunc(op, 3, 0x7, 0);
78                  return(1);
79 +        case PAT_SPECFUNC:      /* spectral function */
80 +                getfunc(op, 1, 0, 0);
81 +                return(1);
82 +        case PAT_SPECFILE:      /* spectrum file */
83 +                if (op->oargs.nsargs < 1)
84 +                        goto sargerr;
85 +                getdata(op->oargs.sarg[0]);
86 +                return(1);
87 +        case PAT_SPECDATA:      /* spectral data file */
88 +                if (op->oargs.nsargs < 2)
89 +                        goto sargerr;
90 +                dp = getdata(op->oargs.sarg[1]);
91 +                getfunc(op, 2, ((1<<(dp->nd-1)) - 1)<<3, 0);
92 +                return(1);
93 +        case PAT_SPECPICT:      /* spectral picture */
94 +                if (op->oargs.nsargs < 2)
95 +                        goto sargerr;
96 +                getspec(op->oargs.sarg[1]);
97 +                getfunc(op, 2, 0x3<<3, 0);
98 +                return(1);
99          case TEX_DATA:          /* texture data */
100                  if (op->oargs.nsargs < 6)
101                          goto sargerr;
# Line 104 | Line 129 | load_os(                       /* load associated data for object */
129                  if (op->oargs.nsargs < 6)
130                          goto sargerr;
131                  getfunc(op, 5, 0x1d, 1);
132 <                loadBSDF(op->oargs.sarg[1]);
132 >                sd = loadBSDF(op->oargs.sarg[1]);
133 >                if (sd != NULL) SDfreeCache(sd);
134 >                return(1);
135 >        case MAT_ABSDF:         /* aBSDF material */
136 >                if (op->oargs.nsargs < 5)
137 >                        goto sargerr;
138 >                getfunc(op, 4, 0xe, 1);
139 >                sd = loadBSDF(op->oargs.sarg[0]);
140 >                if (sd != NULL) SDfreeCache(sd);
141                  return(1);
142          case MAT_PDATA:         /* plastic BRDF data */
143          case MAT_MDATA:         /* metal BRDF data */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines