--- ray/src/rt/preload.c 2003/02/25 02:47:23 2.7 +++ ray/src/rt/preload.c 2011/02/18 02:41:55 2.11 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: preload.c,v 2.7 2003/02/25 02:47:23 greg Exp $"; +static const char RCSid[] = "$Id: preload.c,v 2.11 2011/02/18 02:41:55 greg Exp $"; #endif /* * Preload associated object structures to maximize memory sharing. @@ -9,25 +9,27 @@ static const char RCSid[] = "$Id: preload.c,v 2.7 2003 #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 "color.h" +#include "mesh.h" #include "data.h" +#include "func.h" +#include "bsdf.h" /* KEEP THIS ROUTINE CONSISTENT WITH THE DIFFERENT OBJECT FUNCTIONS! */ -int -load_os(op) /* load associated data for object */ -register OBJREC *op; +extern int +load_os( /* load associated data for object */ + register OBJREC *op +) { DATARRAY *dp; + SDData *sd; switch (op->otype) { case OBJ_FACE: /* polygon */ @@ -43,6 +45,9 @@ register OBJREC *op; case OBJ_INSTANCE: /* octree instance */ getinstance(op, IO_ALL); return(1); + case OBJ_MESH: /* mesh instance */ + getmeshinst(op, IO_ALL); + return(1); case PAT_CPICT: /* color picture */ if (op->oargs.nsargs < 4) goto sargerr; @@ -96,6 +101,12 @@ register OBJREC *op; 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 */ @@ -120,11 +131,12 @@ register OBJREC *op; return(0); sargerr: objerror(op, USER, "too few string arguments"); + return 0; /* pro forma return */ } -void -preload_objs() /* preload object data structures */ +extern void +preload_objs(void) /* preload object data structures */ { register OBJECT on; /* note that nobjects may change during loop */