--- ray/src/common/object.h 1991/07/24 14:15:51 1.3 +++ ray/src/common/object.h 1998/11/05 16:51:26 2.6 @@ -19,7 +19,7 @@ typedef struct { short nsargs; /* # of string arguments */ short nfargs; /* # of real arguments */ char **sarg; /* string arguments */ - double *farg; /* real arguments */ + FLOAT *farg; /* real arguments */ #ifdef IARGS short niargs; /* # of integer arguments */ long *iarg; /* integer arguments */ @@ -34,7 +34,13 @@ typedef struct { * and the modifier index. */ -typedef short OBJECT; /* index into object array */ +#ifndef OBJECT +#ifdef BIGMEM +#define OBJECT int4 /* index to object array */ +#else +#define OBJECT int2 /* index to object array */ +#endif +#endif typedef struct { OBJECT omod; /* modifier number */ @@ -42,15 +48,22 @@ typedef struct { char *oname; /* object name */ FUNARGS oargs; /* object specification */ char *os; /* object structure */ - long lastrno; /* last ray this was used with */ } OBJREC; -#define MAXOBJBLK 511 /* maximum number of object blocks */ +#ifndef MAXOBJBLK +#ifdef BIGMEM +#define MAXOBJBLK 65535 /* maximum number of object blocks */ +#else +#define MAXOBJBLK 31 /* maximum number of object blocks */ +#endif +#endif extern OBJREC *objblock[MAXOBJBLK]; /* the object blocks */ extern OBJECT nobjects; /* # of objects */ -#define objptr(obj) (objblock[(obj)>>6]+((obj)&077)) +#define OBJBLKSHFT 9 +#define OBJBLKSIZ (1<>OBJBLKSHFT]+((obj)&(OBJBLKSIZ-1))) #define OVOID (-1) /* void object */ #define VOIDID "void" /* void identifier */ @@ -61,3 +74,7 @@ extern OBJECT nobjects; /* # of objects */ */ #define MAXSET 127 /* maximum object set size */ + +OBJECT *setsave(); + +#define setfree(os) free((char *)(os))