--- ray/src/rt/preload.c 1993/01/20 15:19:17 2.1 +++ ray/src/rt/preload.c 1996/07/03 17:31:02 2.5 @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 Regents of the University of California */ +/* Copyright (c) 1996 Regents of the University of California */ #ifndef lint static char SCCSid[] = "$SunId$ LBL"; @@ -9,11 +9,13 @@ static char SCCSid[] = "$SunId$ LBL"; */ #include "standard.h" -#include "octree.h" #include "object.h" #include "otypes.h" #include "face.h" #include "cone.h" +#include "instance.h" +#include "color.h" +#include "data.h" int @@ -34,16 +36,41 @@ register OBJREC *op; case OBJ_INSTANCE: /* octree instance */ getinstance(op, IO_ALL); return(1); - default: /* don't bother */ - return(0); + case PAT_CPICT: /* color picture */ + if (op->oargs.nsargs < 4) + goto sargerr; + getpict(op->oargs.sarg[3]); + return(1); + case PAT_CDATA: /* color data */ + /* FALL THROUGH */ + case TEX_DATA: /* texture data */ + if (op->oargs.nsargs < 6) + goto sargerr; + getdata(op->oargs.sarg[3]); + getdata(op->oargs.sarg[4]); + getdata(op->oargs.sarg[5]); + return(1); + case PAT_BDATA: /* brightness data */ + /* FALL THROUGH */ + case MAT_PDATA: /* plastic BRDF data */ + case MAT_MDATA: /* metal BRDF data */ + case MAT_TDATA: /* trans BRDF data */ + if (op->oargs.nsargs < 2) + goto sargerr; + getdata(op->oargs.sarg[1]); + return(1); } + /* don't bother with others -- too tricky */ + return(0); +sargerr: + objerror(op, USER, "too few string arguments"); } preload_objs() /* preload object data structures */ { register OBJECT on; - /* note that nobjects may change during */ + /* note that nobjects may change during loop */ for (on = 0; on < nobjects; on++) load_os(objptr(on)); }