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 |
|
|
22 |
|
|
23 |
|
/* KEEP THIS ROUTINE CONSISTENT WITH THE DIFFERENT OBJECT FUNCTIONS! */ |
24 |
|
|
25 |
|
|
26 |
|
int |
27 |
< |
load_os(op) /* load associated data for object */ |
28 |
< |
register OBJREC *op; |
27 |
> |
load_os( /* load associated data for object */ |
28 |
> |
OBJREC *op |
29 |
> |
) |
30 |
|
{ |
31 |
|
DATARRAY *dp; |
32 |
|
|
44 |
|
case OBJ_INSTANCE: /* octree instance */ |
45 |
|
getinstance(op, IO_ALL); |
46 |
|
return(1); |
47 |
+ |
case OBJ_MESH: /* mesh instance */ |
48 |
+ |
getmeshinst(op, IO_ALL); |
49 |
+ |
return(1); |
50 |
|
case PAT_CPICT: /* color picture */ |
51 |
|
if (op->oargs.nsargs < 4) |
52 |
|
goto sargerr; |
100 |
|
case MAT_BRTDF: /* BRDTfunc material */ |
101 |
|
getfunc(op, 9, 0x3f, 0); |
102 |
|
return(1); |
103 |
+ |
case MAT_BSDF: /* BSDF material */ |
104 |
+ |
if (op->oargs.nsargs < 6) |
105 |
+ |
goto sargerr; |
106 |
+ |
getfunc(op, 5, 0x1d, 1); |
107 |
+ |
loadBSDF(op->oargs.sarg[1]); |
108 |
+ |
return(1); |
109 |
|
case MAT_PDATA: /* plastic BRDF data */ |
110 |
|
case MAT_MDATA: /* metal BRDF data */ |
111 |
|
case MAT_TDATA: /* trans BRDF data */ |
130 |
|
return(0); |
131 |
|
sargerr: |
132 |
|
objerror(op, USER, "too few string arguments"); |
133 |
+ |
return 0; /* pro forma return */ |
134 |
|
} |
135 |
|
|
136 |
|
|
137 |
|
void |
138 |
< |
preload_objs() /* preload object data structures */ |
138 |
> |
preload_objs(void) /* preload object data structures */ |
139 |
|
{ |
140 |
< |
register OBJECT on; |
140 |
> |
OBJECT on; |
141 |
|
/* note that nobjects may change during loop */ |
142 |
|
for (on = 0; on < nobjects; on++) |
143 |
|
load_os(objptr(on)); |