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

Comparing ray/src/ot/writeoct.c (file contents):
Revision 2.3 by greg, Sat Feb 22 02:07:26 2003 UTC vs.
Revision 2.4 by greg, Fri Mar 14 21:27:46 2003 UTC

# Line 1 | Line 1
1   #ifndef lint
2 < static const char       RCSid[] = "$Id$";
2 > static const char RCSid[] = "$Id$";
3   #endif
4   /*
5   *  writeoct.c - routines for writing octree information to stdout.
# Line 13 | Line 13 | static const char      RCSid[] = "$Id$";
13  
14   #include  "object.h"
15  
16 < #include  "otypes.h"
16 > static int  oputint(), oputstr(), puttree();
17  
18 static int  oputint(), oputstr(), puttree(), putobj();
18  
20
19   writeoct(store, scene, ofn)             /* write octree structures to stdout */
20   int  store;
21   CUBE  *scene;
22   char  *ofn[];
23   {
24          char  sbuf[64];
25 <        register int  i;
25 >        int  i;
26                                          /* write format number */
27          oputint((long)(OCTMAGIC+sizeof(OBJECT)), 2);
28  
# Line 53 | Line 51 | char  *ofn[];
51          if (store & IO_FILES || !(store & IO_SCENE))
52                  return;
53                                          /* write the scene */
54 <        for (i = 0; i < NUMOTYPE; i++)
57 <                oputstr(ofun[i].funame);
58 <        oputstr("");
59 <        for (i = 0; i < nobjects; i++)
60 <                putobj(objptr(i));
61 <        putobj(NULL);
54 >        writescene(0, nobjects, stdout);
55   }
56  
57  
# Line 121 | Line 114 | register OCTREE  ot;
114                  putfullnode(ot);                /* write fullnode */
115          } else
116                  putc(OT_EMPTY, stdout);         /* indicate empty */
124 }
125
126
127 static
128 putobj(o)                       /* write out object */
129 register OBJREC  *o;
130 {
131        register int  i;
132
133        if (o == NULL) {                /* terminator */
134                oputint(-1L, 1);
135                return;
136        }
137        oputint((long)o->otype, 1);
138        oputint((long)o->omod, sizeof(OBJECT));
139        oputstr(o->oname);
140        oputint((long)o->oargs.nsargs, 2);
141        for (i = 0; i < o->oargs.nsargs; i++)
142                oputstr(o->oargs.sarg[i]);
143 #ifdef  IARGS
144        oputint((long)o->oargs.niargs, 2);
145        for (i = 0; i < o->oargs.niargs; i++)
146                oputint((long)o->oargs.iarg[i], 4);
147 #endif
148        oputint((long)o->oargs.nfargs, 2);
149        for (i = 0; i < o->oargs.nfargs; i++)
150                oputflt(o->oargs.farg[i]);
117   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines