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.23 by greg, Fri Jun 6 19:11:21 2025 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines