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

Comparing ray/src/hd/rhpict.c (file contents):
Revision 3.6 by gwlarson, Tue Mar 9 14:55:53 1999 UTC vs.
Revision 3.10 by greg, Fri Jun 20 00:25:49 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1999 Silicon Graphics, Inc. */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ SGI";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Radiance holodeck picture generator
6   */
7  
8   #include "rholo.h"
9   #include "view.h"
13 #include "resolu.h"
10  
11   char    *progname;              /* our program name */
12   char    *hdkfile;               /* holodeck file name */
13 + char    gargc;                  /* global argc */
14 + char    **gargv;                /* global argv */
15  
16   VIEW    myview = STDVIEW;       /* current output view */
17   int     xres = 512, yres = 512; /* max. horizontal and vertical resolution */
# Line 37 | Line 35 | char   *argv[];
35   {
36          int     i, rval;
37  
38 +        gargc = argc; gargv = argv;
39          progname = argv[0];                     /* get arguments */
40          for (i = 1; i < argc && argv[i][0] == '-'; i++) {
41                  rval = getviewopt(&myview, argc-i, argv+i);
# Line 144 | Line 143 | int    fn;
143                                          /* render image */
144          if (blist.nb > 0) {
145                  render_frame(blist.bl, blist.nb);
146 <                free((char *)blist.bl);
146 >                free((void *)blist.bl);
147          } else {
148                  sprintf(errmsg, "no section visible in frame %d", fn);
149                  error(WARNING, errmsg);
# Line 181 | Line 180 | int    nb;
180          }
181          hdloadbeams(bil, nb, pixBeam);
182          pixFinish(randfrac);
183 <        free((char *)bil);
183 >        free((void *)bil);
184   }
185  
186  
# Line 205 | Line 204 | int    fn;
204                                  /* write header */
205          newheader("RADIANCE", stdout);
206          printf("SOFTWARE= %s\n", VersionID);
207 <        printf("%s %s\n", progname, hdkfile);
207 >        printargs(gargc, gargv, stdout);
208          if (fn)
209                  printf("FRAME=%d\n", fn);
210          fputs(VIEWSTR, stdout);
# Line 230 | Line 229 | int
229   endpicture()                    /* finish and write out pixels */
230   {
231          int     lastr = -1, nunrend = 0;
232 <        int4    lastp, lastrp;
233 <        register int4   p;
232 >        int32   lastp, lastrp;
233 >        register int32  p;
234          register double d;
235                                  /* compute final pixel values */
236          for (p = hres*vres; p--; ) {
# Line 261 | Line 260 | endpicture()                   /* finish and write out pixels */
260  
261   initialize()                    /* initialize holodeck and buffers */
262   {
264        extern long     ftell();
263          int     fd;
264          FILE    *fp;
265          int     n;
266 <        int4    nextloc;
266 >        int32   nextloc;
267                                          /* open holodeck file */
268          if ((fp = fopen(hdkfile, "r")) == NULL) {
269                  sprintf(errmsg, "cannot open \"%s\" for reading", hdkfile);
# Line 283 | Line 281 | initialize()                   /* initialize holodeck and buffers */
281          fd = dup(fileno(fp));                   /* dup file descriptor */
282          fclose(fp);                             /* done with stdio */
283          for (n = 0; nextloc > 0L; n++) {        /* initialize each section */
284 <                lseek(fd, (long)nextloc, 0);
284 >                lseek(fd, (off_t)nextloc, 0);
285                  read(fd, (char *)&nextloc, sizeof(nextloc));
286                  hdinit(fd, NULL);
287          }
# Line 296 | Line 294 | initialize()                   /* initialize holodeck and buffers */
294   }
295  
296  
297 + void
298   eputs(s)                        /* put error message to stderr */
299   register char  *s;
300   {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines