ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/instance.c
(Generate patch)

Comparing ray/src/common/instance.c (file contents):
Revision 2.2 by greg, Thu Aug 6 16:46:47 1992 UTC vs.
Revision 2.3 by greg, Tue Feb 2 13:24:50 1993 UTC

# Line 16 | Line 16 | static char SCCSid[] = "$SunId$ LBL";
16  
17   #include  "instance.h"
18  
19 + #define  IO_ILLEGAL     (IO_FILES|IO_INFO)
20 +
21   static SCENE  *slist = NULL;            /* list of loaded octrees */
22  
23  
# Line 28 | Line 30 | int  flags;
30          char  *pathname;
31          register SCENE  *sc;
32  
33 <        flags &= ~(IO_FILES|IO_INFO);           /* not allowed */
33 >        flags &= ~IO_ILLEGAL;           /* not allowed */
34          for (sc = slist; sc != NULL; sc = sc->next)
35                  if (!strcmp(sname, sc->name)) {
36                          if ((sc->ldflags & flags) == flags)
# Line 53 | Line 55 | int  flags;
55                  sprintf(errmsg, "cannot find octree file \"%s\"", sname);
56                  error(USER, errmsg);
57          }
58 <        if (flags & ~sc->ldflags & IO_SCENE)
58 >        flags &= ~sc->ldflags;          /* skip what's already loaded */
59 >        if (flags & IO_SCENE)
60                  sc->firstobj = nobjects;
61 <        readoct(pathname, flags & ~sc->ldflags, &sc->scube, NULL);
62 <        if (flags & ~sc->ldflags & IO_SCENE)
61 >        readoct(pathname, flags, &sc->scube, NULL);
62 >        if (flags & IO_SCENE)
63                  sc->nobjs = nobjects - sc->firstobj;
64          sc->ldflags |= flags;
65          return(sc);
# Line 70 | Line 73 | int  flags;
73   {
74          register INSTANCE  *in;
75  
76 +        flags &= ~IO_ILLEGAL;           /* not allowed */
77          if ((in = (INSTANCE *)o->os) == NULL) {
78                  if ((in = (INSTANCE *)malloc(sizeof(INSTANCE))) == NULL)
79                          error(SYSTEM, "out of memory in getinstance");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines