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.8 by schorsch, Tue Mar 30 16:13:01 2004 UTC vs.
Revision 2.16 by greg, Tue Jun 26 14:42:18 2018 UTC

# Line 9 | Line 9 | static const char      RCSid[] = "$Id$";
9  
10   #include "copyright.h"
11  
12 < #include "standard.h"
13 < #include "octree.h"
14 < #include "object.h"
12 > #include "ray.h"
13   #include "otypes.h"
14   #include "face.h"
15   #include "cone.h"
16   #include "instance.h"
17 < #include "color.h"
17 > #include "mesh.h"
18   #include "data.h"
19   #include "func.h"
20 < #include "ray.h"
20 > #include "bsdf.h"
21  
22  
23   /* KEEP THIS ROUTINE CONSISTENT WITH THE DIFFERENT OBJECT FUNCTIONS! */
24  
25  
26 < extern int
26 > int
27   load_os(                        /* load associated data for object */
28 <        register OBJREC *op
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 46 | Line 47 | load_os(                       /* load associated data for object */
47          case OBJ_INSTANCE:      /* octree instance */
48                  getinstance(op, IO_ALL);
49                  return(1);
50 +        case OBJ_MESH:          /* mesh instance */
51 +                getmeshinst(op, IO_ALL);
52 +                return(1);
53          case PAT_CPICT:         /* color picture */
54                  if (op->oargs.nsargs < 4)
55                          goto sargerr;
# Line 99 | Line 103 | load_os(                       /* load associated data for object */
103          case MAT_BRTDF:         /* BRDTfunc material */
104                  getfunc(op, 9, 0x3f, 0);
105                  return(1);
106 +        case MAT_BSDF:          /* BSDF material */
107 +                if (op->oargs.nsargs < 6)
108 +                        goto sargerr;
109 +                getfunc(op, 5, 0x1d, 1);
110 +                sd = loadBSDF(op->oargs.sarg[1]);
111 +                if (sd != NULL) SDfreeCache(sd);
112 +                return(1);
113 +        case MAT_ABSDF:         /* aBSDF material */
114 +                if (op->oargs.nsargs < 5)
115 +                        goto sargerr;
116 +                getfunc(op, 4, 0xe, 1);
117 +                sd = loadBSDF(op->oargs.sarg[0]);
118 +                if (sd != NULL) SDfreeCache(sd);
119 +                return(1);
120          case MAT_PDATA:         /* plastic BRDF data */
121          case MAT_MDATA:         /* metal BRDF data */
122          case MAT_TDATA:         /* trans BRDF data */
# Line 127 | Line 145 | sargerr:
145   }
146  
147  
148 < extern void
148 > void
149   preload_objs(void)              /* preload object data structures */
150   {
151 <        register OBJECT on;
151 >        OBJECT on;
152                                  /* note that nobjects may change during loop */
153          for (on = 0; on < nobjects; on++)
154                  load_os(objptr(on));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines