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

Comparing ray/src/rt/ambient.c (file contents):
Revision 2.48 by greg, Tue Feb 25 02:47:22 2003 UTC vs.
Revision 2.51 by schorsch, Thu Jun 26 00:58:10 2003 UTC

# Line 9 | Line 9 | static const char      RCSid[] = "$Id$";
9  
10   #include "copyright.h"
11  
12 + #include  "platform.h"
13   #include  "ray.h"
13
14   #include  "otypes.h"
15
15   #include  "ambient.h"
17
16   #include  "random.h"
17  
18   #ifndef  OCTSCALE
# Line 35 | Line 33 | static FILE  *ambfp = NULL;    /* ambient file pointer */
33   static int  nunflshed = 0;      /* number of unflushed ambient values */
34  
35   #ifndef SORT_THRESH
36 < #ifdef BIGMEM
39 < #define SORT_THRESH     ((9L<<20)/sizeof(AMBVAL))
40 < #else
36 > #ifdef SMLMEM
37   #define SORT_THRESH     ((3L<<20)/sizeof(AMBVAL))
38 + #else
39 + #define SORT_THRESH     ((9L<<20)/sizeof(AMBVAL))
40   #endif
41   #endif
42   #ifndef SORT_INTVL
# Line 165 | Line 163 | setambient()                           /* initialize calculation */
163                                          (flen - pos)/AMBVALSIZ);
164                          error(WARNING, errmsg);
165                          fseek(ambfp, pos, 0);
166 + #ifndef _WIN32 /* XXX we need a replacement for that one */
167                          ftruncate(fileno(ambfp), (off_t)pos);
168 + #endif
169                  }
170          } else if ((ambfp = fopen(ambfile, "w+")) != NULL) {
171                  initambfile(1);                 /* else create new file */
# Line 474 | Line 474 | int  creat;
474   #ifdef  F_SETLKW
475          aflock(creat ? F_WRLCK : F_RDLCK);
476   #endif
477 < #ifdef MSDOS
478 <        setmode(fileno(ambfp), O_BINARY);
479 < #endif
477 >        SET_FILE_BINARY(ambfp);
478          if (mybuf == NULL)
479                  mybuf = (char *)bmalloc(BUFSIZ+8);
480          setbuf(ambfp, mybuf);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines