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.17 by schorsch, Thu Jan 1 11:21:55 2004 UTC vs.
Revision 3.24 by greg, Sat Jun 7 05:09:46 2025 UTC

# Line 6 | Line 6 | static const char      RCSid[] = "$Id$";
6   */
7  
8   #include <string.h>
9
9   #include "platform.h"
10   #include "rterror.h"
11   #include "rholo.h"
13 #include "view.h"
12  
15 char    *progname;              /* our program name */
13   char    *hdkfile;               /* holodeck file name */
14   char    gargc;                  /* global argc */
15   char    **gargv;                /* global argv */
# Line 51 | Line 48 | char   *argv[]
48          int     i, rval;
49  
50          gargc = argc; gargv = argv;
51 <        progname = argv[0];                     /* get arguments */
51 >        fixargv0(argv[0]);                      /* get arguments */
52          for (i = 1; i < argc && argv[i][0] == '-'; i++) {
53                  rval = getviewopt(&myview, argc-i, argv+i);
54                  if (rval >= 0) {                /* view option */
# Line 183 | Line 180 | dopicture(                     /* render view from holodeck */
180  
181   static void
182   render_frame(           /* render frame from beam values */
183 <        register PACKHEAD       *bl,
183 >        PACKHEAD        *bl,
184          int     nb
185   )
186   {
187 <        register HDBEAMI        *bil;
188 <        register int    i;
187 >        HDBEAMI *bil;
188 >        int     i;
189  
190          if (nb <= 0) return;
191          if ((bil = (HDBEAMI *)malloc(nb*sizeof(HDBEAMI))) == NULL)
# Line 217 | Line 214 | startpicture(          /* initialize picture for rendering & o
214                                  /* prepare output */
215          if (outspec != NULL) {
216                  sprintf(fname, outspec, fn);
217 <                if (freopen(fname, "w", stdout) == NULL) {
217 >                if (freopen(fname, "wb", stdout) == NULL) {
218                          sprintf(errmsg, "cannot open output \"%s\"", fname);
219                          error(SYSTEM, errmsg);
220                  }
# Line 251 | Line 248 | endpicture(void)                       /* finish and write out pixels */
248   {
249          int     lastr = -1, nunrend = 0;
250          int32   lastp, lastrp;
251 <        register int32  p;
252 <        register double d;
251 >        int32   p;
252 >        double  d;
253                                  /* compute final pixel values */
254          for (p = hres*vres; p--; ) {
255                  if (myweight[p] <= FTINY) {
# Line 286 | Line 283 | initialize(void)                       /* initialize holodeck and buffers
283          int     fd;
284          FILE    *fp;
285          int     n;
286 <        int32   nextloc;
286 >        off_t   nextloc;
287                                          /* open holodeck file */
288 <        if ((fp = fopen(hdkfile, "r")) == NULL) {
288 >        if ((fp = fopen(hdkfile, "rb")) == NULL) {
289                  sprintf(errmsg, "cannot open \"%s\" for reading", hdkfile);
290                  error(SYSTEM, errmsg);
291          }
# Line 304 | Line 301 | initialize(void)                       /* initialize holodeck and buffers
301          fd = dup(fileno(fp));                   /* dup file descriptor */
302          fclose(fp);                             /* done with stdio */
303          for (n = 0; nextloc > 0L; n++) {        /* initialize each section */
304 <                lseek(fd, (off_t)nextloc, SEEK_SET);
304 >                lseek(fd, nextloc, SEEK_SET);
305                  read(fd, (char *)&nextloc, sizeof(nextloc));
306                  hdinit(fd, NULL);
307          }
# Line 318 | Line 315 | initialize(void)                       /* initialize holodeck and buffers
315  
316  
317   void
318 < eputs(s)                        /* put error message to stderr */
322 < register char  *s;
318 > eputs(const char *s)            /* put error message to stderr */
319   {
320          static int  midline = 0;
321  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines