--- ray/src/rt/preload.c 2004/03/30 16:13:01 2.8 +++ ray/src/rt/preload.c 2011/02/18 00:40:25 2.10 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: preload.c,v 2.8 2004/03/30 16:13:01 schorsch Exp $"; +static const char RCSid[] = "$Id: preload.c,v 2.10 2011/02/18 00:40:25 greg Exp $"; #endif /* * Preload associated object structures to maximize memory sharing. @@ -9,17 +9,16 @@ static const char RCSid[] = "$Id: preload.c,v 2.8 2004 #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 "ray.h" +#include "bsdf.h" +#include "paths.h" /* KEEP THIS ROUTINE CONSISTENT WITH THE DIFFERENT OBJECT FUNCTIONS! */ @@ -31,6 +30,7 @@ load_os( /* load associated data for object */ ) { DATARRAY *dp; + SDData *sd; switch (op->otype) { case OBJ_FACE: /* polygon */ @@ -46,6 +46,9 @@ load_os( /* load associated data for object */ 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; @@ -98,6 +101,15 @@ load_os( /* load associated data for object */ return(1); 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); + sd = SDgetCache(op->oargs.sarg[1]); + if (sd != NULL && !SDisLoaded(sd)) + SDloadFile(sd, getpath(op->oargs.sarg[1], + getrlibpath(), R_OK)); return(1); case MAT_PDATA: /* plastic BRDF data */ case MAT_MDATA: /* metal BRDF data */