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.7 by greg, Tue Feb 25 02:47:23 2003 UTC vs.
Revision 2.10 by greg, Fri Feb 18 00:40:25 2011 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 "bsdf.h"
21 + #include "paths.h"
22  
23  
24   /* KEEP THIS ROUTINE CONSISTENT WITH THE DIFFERENT OBJECT FUNCTIONS! */
25  
26  
27 < int
28 < load_os(op)                     /* load associated data for object */
29 < register OBJREC *op;
27 > extern int
28 > load_os(                        /* load associated data for object */
29 >        register OBJREC *op
30 > )
31   {
32          DATARRAY  *dp;
33 +        SDData  *sd;
34  
35          switch (op->otype) {
36          case OBJ_FACE:          /* polygon */
# Line 43 | Line 46 | register OBJREC        *op;
46          case OBJ_INSTANCE:      /* octree instance */
47                  getinstance(op, IO_ALL);
48                  return(1);
49 +        case OBJ_MESH:          /* mesh instance */
50 +                getmeshinst(op, IO_ALL);
51 +                return(1);
52          case PAT_CPICT:         /* color picture */
53                  if (op->oargs.nsargs < 4)
54                          goto sargerr;
# Line 96 | Line 102 | register OBJREC        *op;
102          case MAT_BRTDF:         /* BRDTfunc material */
103                  getfunc(op, 9, 0x3f, 0);
104                  return(1);
105 +        case MAT_BSDF:          /* BSDF material */
106 +                if (op->oargs.nsargs < 6)
107 +                        goto sargerr;
108 +                getfunc(op, 5, 0x1d, 1);
109 +                sd = SDgetCache(op->oargs.sarg[1]);
110 +                if (sd != NULL && !SDisLoaded(sd))
111 +                        SDloadFile(sd, getpath(op->oargs.sarg[1],
112 +                                                getrlibpath(), R_OK));
113 +                return(1);
114          case MAT_PDATA:         /* plastic BRDF data */
115          case MAT_MDATA:         /* metal BRDF data */
116          case MAT_TDATA:         /* trans BRDF data */
# Line 120 | Line 135 | register OBJREC        *op;
135          return(0);
136   sargerr:
137          objerror(op, USER, "too few string arguments");
138 +        return 0; /* pro forma return */
139   }
140  
141  
142 < void
143 < preload_objs()          /* preload object data structures */
142 > extern void
143 > preload_objs(void)              /* preload object data structures */
144   {
145          register OBJECT on;
146                                  /* note that nobjects may change during loop */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines