--- ray/src/rt/preload.c 2005/09/15 18:06:23 2.9 +++ ray/src/rt/preload.c 2013/11/08 17:11:42 2.13 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: preload.c,v 2.9 2005/09/15 18:06:23 greg Exp $"; +static const char RCSid[] = "$Id: preload.c,v 2.13 2013/11/08 17:11:42 greg Exp $"; #endif /* * Preload associated object structures to maximize memory sharing. @@ -9,26 +9,23 @@ static const char RCSid[] = "$Id: preload.c,v 2.9 2005 #include "copyright.h" -#include "standard.h" -#include "octree.h" -#include "object.h" +#include "ray.h" #include "otypes.h" #include "face.h" #include "cone.h" #include "instance.h" #include "mesh.h" -#include "color.h" #include "data.h" #include "func.h" -#include "ray.h" +#include "bsdf.h" /* KEEP THIS ROUTINE CONSISTENT WITH THE DIFFERENT OBJECT FUNCTIONS! */ -extern int +int load_os( /* load associated data for object */ - register OBJREC *op + OBJREC *op ) { DATARRAY *dp; @@ -103,6 +100,12 @@ load_os( /* load associated data for object */ case MAT_BRTDF: /* BRDTfunc material */ getfunc(op, 9, 0x3f, 0); return(1); + case MAT_BSDF: /* BSDF material */ + if (op->oargs.nsargs < 6) + goto sargerr; + getfunc(op, 5, 0x1d, 1); + loadBSDF(op->oargs.sarg[1]); + return(1); case MAT_PDATA: /* plastic BRDF data */ case MAT_MDATA: /* metal BRDF data */ case MAT_TDATA: /* trans BRDF data */ @@ -131,10 +134,10 @@ sargerr: } -extern void +void preload_objs(void) /* preload object data structures */ { - register OBJECT on; + OBJECT on; /* note that nobjects may change during loop */ for (on = 0; on < nobjects; on++) load_os(objptr(on));