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.1 by greg, Wed Jan 20 15:19:17 1993 UTC vs.
Revision 2.5 by greg, Wed Jul 3 17:31:02 1996 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1993 Regents of the University of California */
1 > /* Copyright (c) 1996 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 9 | Line 9 | static char SCCSid[] = "$SunId$ LBL";
9   */
10  
11   #include "standard.h"
12 #include "octree.h"
12   #include "object.h"
13   #include "otypes.h"
14   #include "face.h"
15   #include "cone.h"
16 + #include "instance.h"
17 + #include "color.h"
18 + #include "data.h"
19  
20  
21   int
# Line 34 | Line 36 | register OBJREC        *op;
36          case OBJ_INSTANCE:      /* octree instance */
37                  getinstance(op, IO_ALL);
38                  return(1);
39 <        default:                /* don't bother */
40 <                return(0);
39 >        case PAT_CPICT:         /* color picture */
40 >                if (op->oargs.nsargs < 4)
41 >                        goto sargerr;
42 >                getpict(op->oargs.sarg[3]);
43 >                return(1);
44 >        case PAT_CDATA:         /* color data */
45 >                /* FALL THROUGH */
46 >        case TEX_DATA:          /* texture data */
47 >                if (op->oargs.nsargs < 6)
48 >                        goto sargerr;
49 >                getdata(op->oargs.sarg[3]);
50 >                getdata(op->oargs.sarg[4]);
51 >                getdata(op->oargs.sarg[5]);
52 >                return(1);
53 >        case PAT_BDATA:         /* brightness data */
54 >                /* FALL THROUGH */
55 >        case MAT_PDATA:         /* plastic BRDF data */
56 >        case MAT_MDATA:         /* metal BRDF data */
57 >        case MAT_TDATA:         /* trans BRDF data */
58 >                if (op->oargs.nsargs < 2)
59 >                        goto sargerr;
60 >                getdata(op->oargs.sarg[1]);
61 >                return(1);
62          }
63 +                        /* don't bother with others -- too tricky */
64 +        return(0);
65 + sargerr:
66 +        objerror(op, USER, "too few string arguments");
67   }
68  
69  
70   preload_objs()          /* preload object data structures */
71   {
72          register OBJECT on;
73 <                                /* note that nobjects may change during */
73 >                                /* note that nobjects may change during loop */
74          for (on = 0; on < nobjects; on++)
75                  load_os(objptr(on));
76   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines