--- ray/src/common/objset.c 1989/02/02 10:34:37 1.1 +++ ray/src/common/objset.c 1992/03/12 11:41:18 2.2 @@ -16,8 +16,16 @@ static char SCCSid[] = "$SunId$ LBL"; #include "object.h" -#define OSTSIZ 3037 /* object table size (a prime!) */ +#include "otypes.h" +#ifndef OSTSIZ +#ifdef BIGMEM +#define OSTSIZ 56437 /* object table size (a prime!) */ +#else +#define OSTSIZ 12329 /* object table size (a prime!) */ +#endif +#endif + static OBJECT *ostable[OSTSIZ]; /* the object set table */ @@ -42,8 +50,12 @@ OBJECT obj; { register int i; - for (i = (*os++)--; i > 0 && *os < obj; i--, os++) - ; + i = (*os)--; + os++; + while (i > 0 && *os < obj) { + i--; + os++; + } while (--i > 0) { os[0] = os[1]; os++; @@ -173,4 +185,27 @@ OCTREE ot; return; noderr: error(CONSISTENCY, "bad node in objset"); +} + + +nonsurfinset(orig, nobjs) /* check sets for non-surfaces */ +int orig, nobjs; +{ + int n; + register OBJECT *os; + register OBJECT i, s; + + for (n = 0; n < OSTSIZ; n++) { + if ((os = ostable[n]) == NULL) + continue; + while ((i = *os++) > 0) + while (i--) { + s = *os; + if (s >= orig && s < orig+nobjs && + ismodifier(objptr(s)->otype)) + return(1); + os++; + } + } + return(0); }